From 7268d1308fc75ad77a6bf6d48362a0dc1fd6104b Mon Sep 17 00:00:00 2001 From: nion Date: Mon, 23 May 2005 18:58:33 +0000 Subject: [PATCH] Nico Golde: - changed free to secure FREE - updated/rewrote INSTALL file - updated TODO list - updated legal notes - added fork to NEWS git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@300 e385b8ad-14ed-0310-8656-cc95a2468c6d --- BEWARE | 15 --- COPYRIGHT | 9 +- INSTALL | 344 +++++++++++++++------------------------------------ NEWS | 5 +- README | 6 +- TODO.mutt-ng | 4 +- hcache.c | 156 +++-------------------- 7 files changed, 130 insertions(+), 409 deletions(-) delete mode 100644 BEWARE diff --git a/BEWARE b/BEWARE deleted file mode 100644 index d5a7df7..0000000 --- a/BEWARE +++ /dev/null @@ -1,15 +0,0 @@ -MUTT HACKERS BEWARE - -A word of warning about string comparisons: Since mutt may run in a -huge variety of locales, case-insensitive string comparisons and -case conversions may be dangerous. For instance, in iso-8859-9, -tolower('I') is DIFFERENT from 'i' - it's indeed the Turkish dotless -lowercase i. - -For this reason, always use the ascii_* functions defined in ascii.h -and implemented in ascii.c when comparing or handling strings whcih -are defined as us-ascii. This concerns lots of text-based -protocols, message header tags, character set names, domain names, -e-mail addresses, etc. - -Thu Apr 26 15:40:11 CEST 2001, diff --git a/COPYRIGHT b/COPYRIGHT index dbdbacd..c45cccf 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -13,10 +13,11 @@ Copyright (C) 1998-2001 Werner Koch Copyright (C) 1999-2001 Brendan Cully Copyright (C) 1999-2001 Tommi Komulainen Copyright (C) 2000-2001 Edmund Grimley Evans -Parts written/modified by: -Andreas Krennmair -Nico Golde -Rocco Rutte +Copyright (C) 2005: + Parts written/modified by: + Andreas Krennmair + Nico Golde + Rocco Rutte This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/INSTALL b/INSTALL index df858de..923b90b 100644 --- a/INSTALL +++ b/INSTALL @@ -1,215 +1,80 @@ -Supported platforms -=================== - -Mutt-ng has been reported to compile and run under the following Unix operating -systems: - - AIX - BSDI - Convex - Data General Unix (DG/UX) - Digital Unix (OSF/1) - DYNIX/ptx - FreeBSD - HP-UX - IRIX - Linux - Atari MiNT - MkLinux - NetBSD - OpenBSD - QNX - SCO Unix 3.2v4/5 - Solaris - SunOS - Ultrix - UnixWare - -- An ANSI C compiler (such as gcc) is required. - -- You must also have a SysV compatible curses library, or you must - install either - - GNU ncurses, ftp://prep.ai.mit.edu/pub/gnu/ - - or - - S-Lang, ftp://space.mit.edu/pub/davis/slang/ - -- Mutt-ng needs an implementation of the iconv API for character set - conversions. A free one can be found under the following URL: - - http://www.gnu.org/software/libiconv/ - - - -Installation -============ - -Installing Mutt-ng is rather painless through the use of the GNU -autoconf package. Simply untar the Mutt-ng distribution, and run the -``configure'' script. If you have obtained the distribution from -the CVS repository, run the ``prepare'' script with the same command -line parameters you would pass to configure. It will set up Mutt-ng's -build environment and add the files which are present in the tar -balls, but not in the CVS repository. - -In most cases, configure will automatically determine everything it -needs to know in order to compile. However, there are a few options -to ``configure'' to help it out, or change the default behavior: - ---prefix=DIR - install Mutt-ng in DIR instead of /usr/local - ---with-curses=DIR - use the curses lib in DIR/lib. If you have ncurses, ``configure'' - will automatically look in /usr/include/ncurses for the include - files. - ---with-slang[=DIR] - use the S-Lang library instead of ncurses. This library seems to - work better for some people because it is less picky about proper - termcap entries than ncurses. It is recommended that you use at - *least* version 0.99-38 with Mutt-ng. - ---with-mailpath=DIR - specify where the spool mailboxes are located on your system - ---with-homespool[=FILE] - treat file in the user's home directory as the spool mailbox. Note - that this is *not* the full pathname, but relative to the user's - home directory. Defaults to "mailbox" if FILE is not specified. - ---enable-pop - enable POP3 support - ---enable-imap - enable IMAP support - ---with-gss[=PFX] - Enable GSSAPI authentication to IMAP servers. This should work with - both MIT and Heimdal GSSAPI implementations - others haven't been - tested. Note that the Cyrus SASL library also supports GSSAPI, - and may be able to encrypt your session with it - you should use - SASL instead if you can. - ---with-ssl[=PFX] - enable SSL support with IMAP and POP. SSL support requires you to - have OpenSSL headers and libraries properly installed before - compiling. If the OpenSSL headers and libraries are not in the - default system pats you can use the optional PFX argument to - define the root directory of your installation. The libraries - are then expected to be found in PFX/lib and headers in - PFX/include/openssl. - ---with-sasl[=PFX] - Use the Cyrus SASL library for IMAP or POP authentication. This - library provides generic support for several authentication methods, - and more may be added by the system administrator without recompiling - Mutt-ng. SASL may also be able to encrypt your mail session even if - SSL is not available. - ---disable-nls - This switch disables Mutt-ng's native language support. - ---with-included-gettext - Mutt-ng will be built using the GNU gettext library included in - the intl/ sub-directory. You may need to use this switch if - your machine has something which looks like gettext to the - configure script, but isn't able to cope with Mutt-ng's catalog - files. - ---with-regex - use GNU regex instead of local regexp routines. Many systems - don't have the POSIX compliant regcomp/regexec/regfree - routines, so this provides a way to support them. - ---enable-flock - use flock() to lock files. - ---disable-fcntl - by default, Mutt-ng uses fcntl() to lock files. Over NFS this can - result in poor performance on read/write. Note that using this - option could be dangerous if dotlocking is also disabled. - ---enable-nfs-fix - some implementations of NFS do not always write the - atime/mtime of small files. This means that Mutt-ng's ``mailboxes'' - feature does not always work properly, as it uses these - attributes to work out whether the file has new mail. This - option enables a workaround to this bug. - ---enable-locales-fix - on some systems, the result of isprint() can't be used reliably - to decide which characters are printable, even if you set the - LANG environment variable. If you set this option, Mutt-ng will - assume all characters in the ISO-8859-* range are printable. If - you leave it unset, Mutt-ng will attempt to use isprint() if either - of the environment variables LANG, LC_ALL or LC_CTYPE is set, - and will revert to the ISO-8859-* range if they aren't. - If you need --enable-locales-fix then you will probably need - --without-wc-funcs too. However, on a correctly configured - modern system you shouldn't need either (try setting LANG, - LC_ALL or LC_CTYPE instead). - ---without-wc-funcs - by default Mutt-ng uses the functions mbrtowc(), wctomb() and - wcwidth() provided by the system, when they are available. - With this option Mutt-ng will use its own version of those - functions, which should work with 8-bit display charsets, UTF-8, - euc-jp or shift_jis, even if the system doesn't normally support - those multibyte charsets. - - If you find Mutt-ng is displaying non-ascii characters as octal - escape sequences (e.g. \243), even though you have set LANG and - LC_CTYPE correctly, then you might find you can solve the problem - with either or both of --enable-locales-fix and --without-wc-funcs. - ---with-exec-shell=SHELL - on some versions of unix, /bin/sh has a bug that makes using emacs - with Mutt-ng very difficult. If you have the problem that whenever - you press control-G in emacs, Mutt-ng and emacs become very confused, - you may want to try using a Bourne-derived shell other than - /bin/sh here. Some shells that may work are bash, zsh, and ksh. - C shells such as csh and tcsh will amost certainly not work right. - Note that this option is unrelated to what shell Mutt-ng gives you - when you press '!'. Only use this option to solve the above problem, - and only specify one of the above shells as its argument. - - (If you encounter this problem with your platform's native - Bourne shell, please send a short report to mutt-ng-devel@lists.berlios.de, - so a short note on this topic can be added to the Platform notes - section below.) - -Once ``configure'' has completed, simply type ``make install.'' +This document describes the steps which are necessary to +install and use Mutt-ng -Mutt-ng should compile cleanly (without errors) and you should end up with a -binary called ``muttng.'' If you get errors about undefined symbols like -A_NORMAL or KEY_MIN, then you probably don't have a SysV compliant curses -library. You should install either ncurses or S-Lang (see above), and then -run the ``configure'' script again. -Please note that "VPATH" builds currently do _not_ work. +Supported platforms: +==================== +Mutt-ng should run under the following platforms: +AIX, BSDI, Convex, Data General Unix (DG/UX), Digital Unix (OSF/1), +DYNIX/ptx, FreeBSD, HP-UX, IRIX, Linux, Atari MiNT, MkLinux, NetBSD, +OpenBSD, QNX, SCO Unix 3.2v4/5, Solaris, SunOS, Ultrix, UnixWare, +MacOSX -Character set support -===================== -Mutt-ng no longer contains functions for doing character set conversion. -Instead, it expects the iconv functions (iconv_open, iconv, -iconv_close) to be provided. Most up-to-date systems provide these -functions, often as part of the C library. If you are installing Mutt-ng -on a system which does not have them, it is recommended that you -install Bruno Haible's portable libiconv library, which you can obtain -from: +Requirements: +============= + +1. ANSI C compilter. The GNU c compiler would be a good choice + +2. A SysV compatible semigraphic library. + Mutt-ng supports: + - GNU ncurses , ftp://ftp.gnu.org/gnu/ncurses/ + - S-Lang, ftp://space.mit.edu/pub/davis/slang/ + +3. An implementation of the iconv API for character set + conversions. This one is recommend: + http://www.gnu.org/software/libiconv/ + + +Installation: +============= + +1. Installing Mutt-ng is very easy. Just use tar and gzip/bzip2. + For example type: `tar xvfz mutt-ng-20050515.tar.gz'. + If you have obtained the distribution from + the SVN (subversion) repository, run the `prepare' script with the + same command line parameters like it is described in doc/devel-notes.txt + +2. The next step is to call `configure' to configure your installation + depending on your system. + In most cases, configure will automatically determine everything it + needs to know in order to compile. However, there are a few options + to `configure` to help it out, or change the default behavior: + + Configure options: + ================== + + --prefix=DIR + install Mutt-ng in DIR instead of /usr/local + + --with-curses=DIR + use the curses lib in DIR/lib. If you have ncurses, `configure' + will automatically look in /usr/include/ncurses for the include + files. - ftp://ftp.ilog.fr/pub/Users/haible/gnu/ + --with-slang[=DIR] + use the S-Lang library instead of ncurses. This library seems to + work better for some people because it is less picky about proper + termcap entries than ncurses. -Even if your system does provide the iconv functions, you might want -to install libiconv, as some systems provide only a very limited -version of iconv. + This are just a few configure options to get a complete list type: + `configure --help' +3. Once `configure' has completed, simply type `make install.' + +Mutt-ng should compile cleanly (without errors) and you should end up with a +binary called `muttng.' If you get errors about undefined symbols like +A_NORMAL or KEY_MIN, then you probably don't have a SysV compliant curses +library. You should install either ncurses or S-Lang (see above), and then +run the `configure' script again. +Depending on the features you included via configure you can get similliar +errors from other libraries that are missing. + + +Iconv character set support +===================== If you decide to use your system's iconv implementation, you may need to tell Mutt-ng about implementation-defined names for some @@ -223,10 +88,9 @@ like source /usr/local/doc/muttng/samples/iconv/iconv.osf1-4.0d.rc -into your system's global Muttrc, which normally resides in /etc or +into your system's global Muttngrc, which normally resides in /etc or /usr/local/etc. - If you really want to, you can configure Mutt-ng --disable-iconv, but there will then be no character set conversion. @@ -236,55 +100,45 @@ Platform Notes All platforms - There is a bug in most (if not all) S-Lang versions which - prevents the Meta key from working with Mutt-ng. A patch can - be found in the file contrib/patch.slang-1.2.2.keypad.1 in - this Mutt-ng distribution. - - -Solaris 2.4 - - The system regcomp() and regexec() routines are very badly - broken. This should be automatically detected by the - configure script. If not, use the --with-regex switch when - configuring Mutt-ng. - - We are also hearing reports that Solaris 2.4's NLS libraries - dump core with Mutt-ng when using a locale different from "C". - Use the --with-included-gettext configuration switch if you - experience this problem. +There is a bug in most (if not all) S-Lang versions which +prevents the Meta key from working with Mutt-ng. A patch can +be found in the file contrib/patch.slang-1.2.2.keypad.1 in +this Mutt-ng distribution. - Color does not work right with Solaris curses. You will - have to compile with either ncurses or slang to get working - color support. +- Solaris 2.4 -Solaris 2.6 +The system regcomp() and regexec() routines are very badly +broken. This should be automatically detected by the +configure script. If not, use the --with-regex switch when +configuring Mutt-ng. - There are reports that Mutt-ng behaves strangely when linked with - the system regexp library. Please use the --with-regex switch - when configuring on this platform. +We are also hearing reports that Solaris 2.4's NLS libraries +dump core with Mutt-ng when using a locale different from "C". +Use the --with-included-gettext configuration switch if you +experience this problem. - For the real fix, applying Sun patches # 105490-05 (linker - patch) and # 105210-17 (libc and malloc patch) from - sunsolve.sun.com has been reported to stop these problems - from occuring. +Color does not work right with Solaris curses. You will +have to compile with either ncurses or slang to get working +color support. -Linux +- Solaris 2.6 - On recent Linux systems, flock() and fcntl() locks don't mix. If - you use the --enable-flock switch on such systems, be sure to - give the --disable-fcntl argument as well. +There are reports that Mutt-ng behaves strangely when linked with +the system regexp library. Please use the --with-regex switch +when configuring on this platform. -Sparc Linux +For the real fix, applying Sun patches # 105490-05 (linker +patch) and # 105210-17 (libc and malloc patch) from +sunsolve.sun.com has been reported to stop these problems +from occuring. - Redhat 4.2 Sparc users reported problems with some system - include files when building Mutt-ng. Configuring Mutt-ng with the - --disable-warnings switch is said to help against this problem. +- Linux +On recent Linux systems, flock() and fcntl() locks don't mix. If +you use the --enable-flock switch on such systems, be sure to +give the --disable-fcntl argument as well. -Digital Unix (OSF/1) - The system curses library is said to be badly broken. Use GNU - ncurses or SLang instead. +Mo Mai 23 19:52:22 CEST 2005 Nico 'nion' Golde -$Id: INSTALL,v 3.1 2002/11/25 14:16:46 roessler Exp $ + * updated/rewrote document diff --git a/NEWS b/NEWS index b463914..6b2b18f 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ - Visible changes since Mutt 1.2 - ============================== +Visible changes since Mutt 1.2 +============================== +- 2005-01-09: For of Mutt -> Mutt-ng Folder formats and folder access -------------------------------- diff --git a/README b/README index d747c08..f610d55 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ If you got the Mutt-ng source code from the public SVN repository, please read doc/devel-notes.txt to make sure that you have a complete development environment. -Installation instructions are detailed in ``INSTALL''. +Installation instructions are detailed in `INSTALL'. The user manual is in doc/manual.txt. A list of important notes and non-backwards compatible changes is available in UPGRADING. @@ -15,6 +15,8 @@ PGP users should read doc/PGP-Notes.txt. Those who upgrade from a version of mutt prior to 1.1 should read the README.UPGRADE file. -Before you start hacking on mutt-ng, read doc/devel-notes.txt. Before +Before you start hacking on Mutt-ng, read doc/devel-notes.txt. Before applying patches to mutt-ng, read doc/applying-patches.txt. Please, read these files, as they will save you from asking FAQs. + +For further information mutt-ng-devel@lists.berlios.de diff --git a/TODO.mutt-ng b/TODO.mutt-ng index 0039a0d..36f5cc9 100644 --- a/TODO.mutt-ng +++ b/TODO.mutt-ng @@ -20,5 +20,5 @@ Here's a list of all mutt-ng specific TODOs (not in priority order): functions should only be called directly in the right abstraction layer's implementation. And so forth. -- Improve documentation, update/rewrite/remove legacy docs (such as - INSTALL and friends) +- Improve documentation, update/rewrite/remove README.SSL and files in doc/ + all other documents in directory root are up-to-date diff --git a/hcache.c b/hcache.c index f6bcbf8..7e3b0be 100644 --- a/hcache.c +++ b/hcache.c @@ -23,11 +23,7 @@ #ifdef USE_HCACHE -#if HAVE_QDBM -#include -#include -#include -#elif HAVE_GDBM +#if HAVE_GDBM #include #elif HAVE_DB4 #include @@ -48,16 +44,8 @@ #include "md5.h" #include "lib/mem.h" -#include "lib/debug.h" -#if HAVE_QDBM -static struct - header_cache { - VILLA *db; - char *folder; - unsigned int crc; -} HEADER_CACHE; -#elif HAVE_GDBM +#if HAVE_GDBM static struct header_cache { GDBM_FILE db; @@ -177,6 +165,9 @@ static unsigned char *dump_address (ADDRESS * a, unsigned char *d, int *off) d = dump_int (0xdeadbeef, d, off); while (a) { +#ifdef EXACT_ADDRESS + d = dump_char (a->val, d, off); +#endif d = dump_char (a->personal, d, off); d = dump_char (a->mailbox, d, off); d = dump_int (a->group, d, off); @@ -197,6 +188,9 @@ static void restore_address (ADDRESS ** a, const unsigned char *d, int *off) while (counter) { *a = safe_malloc (sizeof (ADDRESS)); +#ifdef EXACT_ADDRESS + restore_char (&(*a)->val, d, off); +#endif restore_char (&(*a)->personal, d, off); restore_char (&(*a)->mailbox, d, off); restore_int ((unsigned int *) &(*a)->group, d, off); @@ -457,6 +451,12 @@ static int generate_crc32 () safe_strlen ("HAVE_LANGINFO_CODESET")); #endif +#if EXACT_ADDRESS + crc = + crc32 (crc, (unsigned char const *) "EXACT_ADDRESS", + safe_strlen ("EXACT_ADDRESS")); +#endif + #ifdef USE_POP crc = crc32 (crc, (unsigned char const *) "USE_POP", safe_strlen ("USE_POP")); @@ -600,129 +600,7 @@ HEADER *mutt_hcache_restore (const unsigned char *d, HEADER ** oh) return h; } -#if HAVE_QDBM -void * -mutt_hcache_open(const char *path, const char *folder) -{ - struct header_cache *h = safe_calloc(1, sizeof (HEADER_CACHE)); - int flags = VL_OWRITER | VL_OCREAT; - h->db = NULL; - h->folder = safe_strdup(folder); - h->crc = generate_crc32(); - - if (!path || path[0] == '\0') - { - FREE(&h->folder); - FREE(&h); - return NULL; - } - - path = mutt_hcache_per_folder(path, folder); - - if (option(OPTHCACHECOMPRESS)) - flags |= VL_OZCOMP; - - h->db = vlopen(path, flags, VL_CMPLEX); - if (h->db) - return h; - else - { - FREE(&h->folder); - FREE(&h); - - return NULL; - } -} - -void -mutt_hcache_close(void *db) -{ - struct header_cache *h = db; - - if (!h) - return; - - vlclose(h->db); - FREE(&h->folder); - FREE(&h); -} - -void * -mutt_hcache_fetch(void *db, const char *filename, - size_t(*keylen) (const char *fn)) -{ - struct header_cache *h = db; - char path[_POSIX_PATH_MAX]; - int ksize; - char *data = NULL; - - if (!h) - return NULL; - - strncpy(path, h->folder, sizeof (path)); - safe_strcat(path, sizeof (path), filename); - - ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); - - data = vlget(h->db, path, ksize, NULL); - - if (! crc32_matches(data, h->crc)) - { - FREE(&data); - return NULL; - } - - return data; -} - -int -mutt_hcache_store(void *db, const char *filename, HEADER * header, - unsigned long uid_validity, - size_t(*keylen) (const char *fn)) -{ - struct header_cache *h = db; - char path[_POSIX_PATH_MAX]; - int ret; - int ksize, dsize; - char *data = NULL; - - if (!h) - return -1; - - strncpy(path, h->folder, sizeof (path)); - safe_strcat(path, sizeof (path), filename); - - ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); - - data = mutt_hcache_dump(db, header, &dsize, uid_validity); - - ret = vlput(h->db, path, ksize, data, dsize, VL_DOVER); - - FREE(&data); - - return ret; -} - -int -mutt_hcache_delete(void *db, const char *filename, - size_t(*keylen) (const char *fn)) -{ - struct header_cache *h = db; - char path[_POSIX_PATH_MAX]; - int ksize; - - if (!h) - return -1; - - strncpy(path, h->folder, sizeof (path)); - safe_strcat(path, sizeof (path), filename); - - ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); - - return vlout(h->db, path, ksize); -} - -#elif HAVE_GDBM +#if HAVE_GDBM void *mutt_hcache_open (const char *path, const char *folder) { @@ -793,7 +671,7 @@ void *mutt_hcache_fetch (void *db, const char *filename, data = gdbm_fetch (h->db, key); if (!crc32_matches (data.dptr, h->crc)) { - free (data.dptr); + FREE(data.dptr); return NULL; } @@ -973,7 +851,7 @@ void *mutt_hcache_fetch (void *db, const char *filename, h->db->get (h->db, NULL, &key, &data, 0); if (!crc32_matches (data.data, h->crc)) { - free (data.data); + FREE(data.data); return NULL; } -- 2.20.1