[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: citadel/webcit/libcitadel 8.12



On Mon, Jul 02, 2012 at 12:42:55PM +0100, Jonathan Wiltshire wrote:
> See the announcement [1] and linked from that, #3 on the freeze policy.
> 
> 1: http://lists.debian.org/debian-devel-announce/2012/06/msg00009.html

I'm still not really sure what to do because there are several bugs fixed that
were never reported against Debian. The only one that was is #676802. That's
why I asked about upstream's changelog.

Anyway, here are the debdiffs. Maybe these clear things up a bit. Most of the
size comes from changes to autoconf cache files. 

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at googlemail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
diff -Nru libcitadel-8.11/autom4te.cache/output.0 libcitadel-8.12/autom4te.cache/output.0
--- libcitadel-8.11/autom4te.cache/output.0	2012-05-22 16:58:20.000000000 +0200
+++ libcitadel-8.12/autom4te.cache/output.0	2012-06-26 16:54:14.000000000 +0200
@@ -1,6 +1,6 @@
 @%:@! /bin/sh
 @%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.67 for libcitadel 2.8.11.
+@%:@ Generated by GNU Autoconf 2.67 for libcitadel 2.8.12.
 @%:@
 @%:@ Report bugs to <http://uncensored.citadel.org>.
 @%:@ 
@@ -706,8 +706,8 @@
 # Identity of this package.
 PACKAGE_NAME='libcitadel'
 PACKAGE_TARNAME='libcitadel'
-PACKAGE_VERSION='2.8.11'
-PACKAGE_STRING='libcitadel 2.8.11'
+PACKAGE_VERSION='2.8.12'
+PACKAGE_STRING='libcitadel 2.8.12'
 PACKAGE_BUGREPORT='http://uncensored.citadel.org'
 PACKAGE_URL=''
 
@@ -1397,7 +1397,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libcitadel 2.8.11 to adapt to many kinds of systems.
+\`configure' configures libcitadel 2.8.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1462,7 +1462,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libcitadel 2.8.11:";;
+     short | recursive ) echo "Configuration of libcitadel 2.8.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1568,7 +1568,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libcitadel configure 2.8.11
+libcitadel configure 2.8.12
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2196,7 +2196,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libcitadel $as_me 2.8.11, which was
+It was created by libcitadel $as_me 2.8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -2579,7 +2579,7 @@
 
 
 LIBCURRENT=2
-LIBREVISION=811
+LIBREVISION=812
 LIBAGE=0
 
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
@@ -19094,6 +19094,50 @@
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system knows about splice()" >&5
+$as_echo_n "checking whether your system knows about splice()... " >&6; } 
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <fcntl.h>
+
+int
+main ()
+{
+
+	ssize_t sent, pipesize;
+	int fd, SplicePipe[2];
+	pipesize = splice(fd, NULL, 
+			  SplicePipe[1], NULL, 
+			  1, 
+			  SPLICE_F_MORE | SPLICE_F_MOVE|SPLICE_F_NONBLOCK);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  
+		  ok_splice=yes
+		  
+$as_echo "@%:@define LINUX_SPLICE /**/" >>confdefs.h
+
+		  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+		
+else
+   
+		  ok_splice=no
+		  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 for ac_header in iconv.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default"
@@ -19916,7 +19960,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libcitadel $as_me 2.8.11, which was
+This file was extended by libcitadel $as_me 2.8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19978,7 +20022,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libcitadel config.status 2.8.11
+libcitadel config.status 2.8.12
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff -Nru libcitadel-8.11/autom4te.cache/traces.0 libcitadel-8.12/autom4te.cache/traces.0
--- libcitadel-8.11/autom4te.cache/traces.0	2012-05-22 16:58:20.000000000 +0200
+++ libcitadel-8.12/autom4te.cache/traces.0	2012-06-26 16:54:14.000000000 +0200
@@ -1,4 +1,4 @@
-m4trace:configure.in:8: -1- AC_INIT([libcitadel], [2.8.11], [http://uncensored.citadel.org])
+m4trace:configure.in:8: -1- AC_INIT([libcitadel], [2.8.12], [http://uncensored.citadel.org])
 m4trace:configure.in:8: -1- m4_pattern_forbid([^_?A[CHUM]_])
 m4trace:configure.in:8: -1- m4_pattern_forbid([_AC_])
 m4trace:configure.in:8: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
@@ -588,68 +588,75 @@
 m4trace:configure.in:77: -1- m4_pattern_allow([^LINUX_SENDFILE$])
 m4trace:configure.in:77: -1- AH_OUTPUT([LINUX_SENDFILE], [/* whether we have the linux sendfile api */
 @%:@undef LINUX_SENDFILE])
-m4trace:configure.in:81: -1- AH_OUTPUT([HAVE_ICONV_H], [/* Define to 1 if you have the <iconv.h> header file. */
+m4trace:configure.in:82: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:2602: AC_TRY_COMPILE is expanded from...
+configure.in:82: the top level])
+m4trace:configure.in:82: -1- AC_DEFINE_TRACE_LITERAL([LINUX_SPLICE])
+m4trace:configure.in:82: -1- m4_pattern_allow([^LINUX_SPLICE$])
+m4trace:configure.in:82: -1- AH_OUTPUT([LINUX_SPLICE], [/* whether we have the linux splice api */
+@%:@undef LINUX_SPLICE])
+m4trace:configure.in:107: -1- AH_OUTPUT([HAVE_ICONV_H], [/* Define to 1 if you have the <iconv.h> header file. */
 @%:@undef HAVE_ICONV_H])
-m4trace:configure.in:81: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ICONV_H])
-m4trace:configure.in:81: -1- m4_pattern_allow([^HAVE_ICONV_H$])
-m4trace:configure.in:90: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
+m4trace:configure.in:107: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ICONV_H])
+m4trace:configure.in:107: -1- m4_pattern_allow([^HAVE_ICONV_H$])
+m4trace:configure.in:116: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
 You should run autoupdate.], [../../lib/autoconf/general.m4:2752: AC_TRY_RUN is expanded from...
-configure.in:90: the top level])
-m4trace:configure.in:90: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [../../lib/autoconf/general.m4:2736: AC_RUN_IFELSE is expanded from...
+configure.in:116: the top level])
+m4trace:configure.in:116: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [../../lib/autoconf/general.m4:2736: AC_RUN_IFELSE is expanded from...
 ../../lib/autoconf/general.m4:2752: AC_TRY_RUN is expanded from...
-configure.in:90: the top level])
-m4trace:configure.in:114: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
+configure.in:116: the top level])
+m4trace:configure.in:140: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
 You should run autoupdate.], [../../lib/autoconf/general.m4:2752: AC_TRY_RUN is expanded from...
-configure.in:114: the top level])
-m4trace:configure.in:114: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [../../lib/autoconf/general.m4:2736: AC_RUN_IFELSE is expanded from...
+configure.in:140: the top level])
+m4trace:configure.in:140: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [../../lib/autoconf/general.m4:2736: AC_RUN_IFELSE is expanded from...
 ../../lib/autoconf/general.m4:2752: AC_TRY_RUN is expanded from...
-configure.in:114: the top level])
-m4trace:configure.in:135: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ICONV])
-m4trace:configure.in:135: -1- m4_pattern_allow([^HAVE_ICONV$])
-m4trace:configure.in:135: -1- AH_OUTPUT([HAVE_ICONV], [/* whether we have iconv for charset conversion */
+configure.in:140: the top level])
+m4trace:configure.in:161: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ICONV])
+m4trace:configure.in:161: -1- m4_pattern_allow([^HAVE_ICONV$])
+m4trace:configure.in:161: -1- AH_OUTPUT([HAVE_ICONV], [/* whether we have iconv for charset conversion */
 @%:@undef HAVE_ICONV])
-m4trace:configure.in:141: -1- AH_OUTPUT([HAVE_BACKTRACE], [/* Define to 1 if you have the `backtrace\' function. */
+m4trace:configure.in:167: -1- AH_OUTPUT([HAVE_BACKTRACE], [/* Define to 1 if you have the `backtrace\' function. */
 @%:@undef HAVE_BACKTRACE])
-m4trace:configure.in:141: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BACKTRACE])
-m4trace:configure.in:141: -1- m4_pattern_allow([^HAVE_BACKTRACE$])
-m4trace:configure.in:155: -1- AH_OUTPUT([HAVE_ZLIB_H], [/* Define to 1 if you have the <zlib.h> header file. */
+m4trace:configure.in:167: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BACKTRACE])
+m4trace:configure.in:167: -1- m4_pattern_allow([^HAVE_BACKTRACE$])
+m4trace:configure.in:181: -1- AH_OUTPUT([HAVE_ZLIB_H], [/* Define to 1 if you have the <zlib.h> header file. */
 @%:@undef HAVE_ZLIB_H])
-m4trace:configure.in:155: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ZLIB_H])
-m4trace:configure.in:155: -1- m4_pattern_allow([^HAVE_ZLIB_H$])
-m4trace:configure.in:163: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ZLIB])
-m4trace:configure.in:163: -1- m4_pattern_allow([^HAVE_ZLIB$])
-m4trace:configure.in:163: -1- AH_OUTPUT([HAVE_ZLIB], [/* whether we have zlib */
+m4trace:configure.in:181: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ZLIB_H])
+m4trace:configure.in:181: -1- m4_pattern_allow([^HAVE_ZLIB_H$])
+m4trace:configure.in:189: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ZLIB])
+m4trace:configure.in:189: -1- m4_pattern_allow([^HAVE_ZLIB$])
+m4trace:configure.in:189: -1- AH_OUTPUT([HAVE_ZLIB], [/* whether we have zlib */
 @%:@undef HAVE_ZLIB])
-m4trace:configure.in:169: -1- AC_SUBST([LIBS])
-m4trace:configure.in:169: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:169: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:170: -1- AC_DEFINE_TRACE_LITERAL([const])
-m4trace:configure.in:170: -1- m4_pattern_allow([^const$])
-m4trace:configure.in:170: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */
+m4trace:configure.in:195: -1- AC_SUBST([LIBS])
+m4trace:configure.in:195: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.in:195: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.in:196: -1- AC_DEFINE_TRACE_LITERAL([const])
+m4trace:configure.in:196: -1- m4_pattern_allow([^const$])
+m4trace:configure.in:196: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */
 @%:@undef const])
-m4trace:configure.in:171: -1- AC_DEFINE_TRACE_LITERAL([size_t])
-m4trace:configure.in:171: -1- m4_pattern_allow([^size_t$])
-m4trace:configure.in:171: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if <sys/types.h> does not define. */
+m4trace:configure.in:197: -1- AC_DEFINE_TRACE_LITERAL([size_t])
+m4trace:configure.in:197: -1- m4_pattern_allow([^size_t$])
+m4trace:configure.in:197: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if <sys/types.h> does not define. */
 @%:@undef size_t])
-m4trace:configure.in:172: -1- AH_OUTPUT([HAVE_MEMMOVE], [/* Define to 1 if you have the `memmove\' function. */
+m4trace:configure.in:198: -1- AH_OUTPUT([HAVE_MEMMOVE], [/* Define to 1 if you have the `memmove\' function. */
 @%:@undef HAVE_MEMMOVE])
-m4trace:configure.in:172: -1- AH_OUTPUT([HAVE_BCOPY], [/* Define to 1 if you have the `bcopy\' function. */
+m4trace:configure.in:198: -1- AH_OUTPUT([HAVE_BCOPY], [/* Define to 1 if you have the `bcopy\' function. */
 @%:@undef HAVE_BCOPY])
-m4trace:configure.in:174: -1- AC_CONFIG_FILES([Makefile libcitadel.pc tests/Makefile])
-m4trace:configure.in:175: -1- AC_CONFIG_HEADERS([sysdep.h])
-m4trace:configure.in:176: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
-m4trace:configure.in:176: -1- m4_pattern_allow([^LIB@&t@OBJS$])
-m4trace:configure.in:176: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([LTLIBOBJS])
-m4trace:configure.in:176: -1- m4_pattern_allow([^LTLIBOBJS$])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([top_builddir])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([top_build_prefix])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([srcdir])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([abs_srcdir])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([top_srcdir])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([abs_top_srcdir])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([builddir])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([abs_builddir])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([abs_top_builddir])
-m4trace:configure.in:176: -1- AC_SUBST_TRACE([INSTALL])
+m4trace:configure.in:200: -1- AC_CONFIG_FILES([Makefile libcitadel.pc tests/Makefile])
+m4trace:configure.in:201: -1- AC_CONFIG_HEADERS([sysdep.h])
+m4trace:configure.in:202: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
+m4trace:configure.in:202: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.in:202: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([LTLIBOBJS])
+m4trace:configure.in:202: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([top_builddir])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([top_build_prefix])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([srcdir])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([abs_srcdir])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([top_srcdir])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([abs_top_srcdir])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([builddir])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([abs_builddir])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([abs_top_builddir])
+m4trace:configure.in:202: -1- AC_SUBST_TRACE([INSTALL])
diff -Nru libcitadel-8.11/configure libcitadel-8.12/configure
--- libcitadel-8.11/configure	2012-05-22 16:58:21.000000000 +0200
+++ libcitadel-8.12/configure	2012-06-26 16:54:15.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for libcitadel 2.8.11.
+# Generated by GNU Autoconf 2.67 for libcitadel 2.8.12.
 #
 # Report bugs to <http://uncensored.citadel.org>.
 #
@@ -706,8 +706,8 @@
 # Identity of this package.
 PACKAGE_NAME='libcitadel'
 PACKAGE_TARNAME='libcitadel'
-PACKAGE_VERSION='2.8.11'
-PACKAGE_STRING='libcitadel 2.8.11'
+PACKAGE_VERSION='2.8.12'
+PACKAGE_STRING='libcitadel 2.8.12'
 PACKAGE_BUGREPORT='http://uncensored.citadel.org'
 PACKAGE_URL=''
 
@@ -1397,7 +1397,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libcitadel 2.8.11 to adapt to many kinds of systems.
+\`configure' configures libcitadel 2.8.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1462,7 +1462,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libcitadel 2.8.11:";;
+     short | recursive ) echo "Configuration of libcitadel 2.8.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1568,7 +1568,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libcitadel configure 2.8.11
+libcitadel configure 2.8.12
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2196,7 +2196,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libcitadel $as_me 2.8.11, which was
+It was created by libcitadel $as_me 2.8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -2579,7 +2579,7 @@
 
 
 LIBCURRENT=2
-LIBREVISION=811
+LIBREVISION=812
 LIBAGE=0
 
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
@@ -19094,6 +19094,50 @@
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system knows about splice()" >&5
+$as_echo_n "checking whether your system knows about splice()... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <fcntl.h>
+
+int
+main ()
+{
+
+	ssize_t sent, pipesize;
+	int fd, SplicePipe[2];
+	pipesize = splice(fd, NULL,
+			  SplicePipe[1], NULL,
+			  1,
+			  SPLICE_F_MORE | SPLICE_F_MOVE|SPLICE_F_NONBLOCK);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+		  ok_splice=yes
+
+$as_echo "#define LINUX_SPLICE /**/" >>confdefs.h
+
+		  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+		  ok_splice=no
+		  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 for ac_header in iconv.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default"
@@ -19916,7 +19960,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libcitadel $as_me 2.8.11, which was
+This file was extended by libcitadel $as_me 2.8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19978,7 +20022,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libcitadel config.status 2.8.11
+libcitadel config.status 2.8.12
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff -Nru libcitadel-8.11/configure.in libcitadel-8.12/configure.in
--- libcitadel-8.11/configure.in	2012-07-02 14:06:48.000000000 +0200
+++ libcitadel-8.12/configure.in	2012-07-02 14:06:48.000000000 +0200
@@ -5,7 +5,7 @@
 dnl Ensure that libcitadel is configured with autoconf 2.52 or newer
 AC_PREREQ(2.52)
 
-AC_INIT(libcitadel, 2.8.11, http://uncensored.citadel.org)
+AC_INIT(libcitadel, 2.8.12, http://uncensored.citadel.org)
 
 AC_CONFIG_SRCDIR(Makefile.in)
 AC_CONFIG_AUX_DIR(conftools)
@@ -23,7 +23,7 @@
 dnl
 
 LIBCURRENT=2
-LIBREVISION=811
+LIBREVISION=812
 LIBAGE=0
 
 sinclude(conftools/libtool.m4)
@@ -102,6 +102,32 @@
                ]
 )
 
+AC_MSG_CHECKING([whether your system knows about splice()]) 
+AC_TRY_COMPILE([
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <fcntl.h>
+],
+[
+	ssize_t sent, pipesize;
+	int fd, SplicePipe[2];
+	pipesize = splice(fd, NULL, 
+			  SplicePipe[1], NULL, 
+			  1, 
+			  SPLICE_F_MORE | SPLICE_F_MOVE|SPLICE_F_NONBLOCK);
+],
+		[
+		  ok_splice=yes
+		  AC_DEFINE(LINUX_SPLICE, [], [whether we have the linux splice api])
+		  AC_MSG_RESULT([yes])
+		],
+		[ 
+		  ok_splice=no
+		  AC_MSG_RESULT([no])
+		]
+)
+
+
 AC_CHECK_HEADERS(iconv.h)
 
 
diff -Nru libcitadel-8.11/debian/changelog libcitadel-8.12/debian/changelog
--- libcitadel-8.11/debian/changelog	2012-07-02 14:06:48.000000000 +0200
+++ libcitadel-8.12/debian/changelog	2012-07-02 14:06:48.000000000 +0200
@@ -1,3 +1,9 @@
+libcitadel (8.12-1) unstable; urgency=low
+
+  * Imported Upstream version 8.12
+
+ -- Michael Meskes <meskes@debian.org>  Thu, 28 Jun 2012 10:40:18 +0200
+
 libcitadel (8.11-2) unstable; urgency=low
 
   * Applied upstream's patch to fix compilation problem on kFreeBSD.
diff -Nru libcitadel-8.11/lib/hash.c libcitadel-8.12/lib/hash.c
--- libcitadel-8.11/lib/hash.c	2012-05-22 16:58:19.000000000 +0200
+++ libcitadel-8.12/lib/hash.c	2012-06-26 16:54:13.000000000 +0200
@@ -173,10 +173,12 @@
  */
 int dbg_PrintHash(HashList *Hash, PrintHashContent First, PrintHashContent Second)
 {
+#ifdef DEBUG
 	const char *foo;
 	const char *bar;
 	const char *bla = "";
 	long key;
+#endif
 	long i;
 
 	if (Hash == NULL)
@@ -193,22 +195,39 @@
 		
 		if (Hash->LookupTable[i] == NULL)
 		{
+#ifdef DEBUG
 			foo = "";
 			bar = "";
 			key = 0;
+#endif
 		}
 		else 
 		{
+#ifdef DEBUG
 			key = Hash->LookupTable[i]->Key;
 			foo = Hash->LookupTable[i]->HashKey;
+#endif
 			if (First != NULL)
-				bar = First(Hash->Members[Hash->LookupTable[i]->Position]->Data);
+#ifdef DEBUG
+				bar =
+#endif
+					First(Hash->Members[Hash->LookupTable[i]->Position]->Data);
+#ifdef DEBUG
 			else 
 				bar = "";
+#endif
+
 			if (Second != NULL)
-				bla = Second(Hash->Members[Hash->LookupTable[i]->Position]->Data);
+#ifdef DEBUG
+				bla = 
+#endif 
+					Second(Hash->Members[Hash->LookupTable[i]->Position]->Data);
+#ifdef DEBUG
+
 			else
 				bla = "";
+#endif
+
 		}
 #ifdef DEBUG
 		printf (" ---- Hashkey[%ld][%ld]: '%s' Value: '%s' ; %s\n", i, key, foo, bar, bla);
diff -Nru libcitadel-8.11/lib/libcitadel.h libcitadel-8.12/lib/libcitadel.h
--- libcitadel-8.11/lib/libcitadel.h	2012-05-22 16:58:19.000000000 +0200
+++ libcitadel-8.12/lib/libcitadel.h	2012-06-26 16:54:13.000000000 +0200
@@ -28,7 +28,7 @@
 #include <sys/types.h>
 #include <netinet/in.h>
 
-#define LIBCITADEL_VERSION_NUMBER	811
+#define LIBCITADEL_VERSION_NUMBER	812
 
 /*
  * Here's a bunch of stupid magic to make the MIME parser portable.
@@ -255,8 +255,10 @@
 	IOBuffer *IOB;
 	int OtherFD;
 	int SplicePipe[2];
+	int PipeSize;
 	long TotalSendSize;
 	long TotalSentAlready;
+	long TotalReadAlready;
 	long ChunkSize;
 	long ChunkSendRemain;
 	StrBuf *ChunkBuffer; /* just used if we don't have sendfile */
@@ -267,6 +269,7 @@
 void FDIOBufferDelete(FDIOBuffer *FDB);
 int FileSendChunked(FDIOBuffer *FDB, const char **Err);
 int FileRecvChunked(FDIOBuffer *FDB, const char **Err);
+int FileMoveChunked(FDIOBuffer *FDB, const char **Err);
 eReadState WriteIOBAlreadyRead(FDIOBuffer *FDB, const char **Error);
 
 long StrBuf_read_one_chunk_callback (int fd, short event, IOBuffer *FB);
@@ -278,6 +281,7 @@
 
 int StrBufSipLine(StrBuf *LineBuf, const StrBuf *Buf, const char **Ptr);
 int StrBufReplaceToken(StrBuf *Buf, long where, long HowLong, const char *Repl, long ReplLen);
+int StrBufExtract_tokenFromStr(StrBuf *dest, const char *Source, long SourceLen, int parmnum, char separator);
 int StrBufExtract_token(StrBuf *dest, const StrBuf *Source, int parmnum, char separator);
 int StrBufSub(StrBuf *dest, const StrBuf *Source, unsigned long Offset, size_t nChars);
 
diff -Nru libcitadel-8.11/lib/mime_parser.c libcitadel-8.12/lib/mime_parser.c
--- libcitadel-8.11/lib/mime_parser.c	2012-05-22 16:58:19.000000000 +0200
+++ libcitadel-8.12/lib/mime_parser.c	2012-06-26 16:54:13.000000000 +0200
@@ -178,7 +178,6 @@
 			}
 			else
 			{
-				ch = 0;
 				ch = _decode_hex(&encoded[pos]);
 				pos += 2;
 				decoded[decoded_length++] = ch;
diff -Nru libcitadel-8.11/lib/stringbuf.c libcitadel-8.12/lib/stringbuf.c
--- libcitadel-8.11/lib/stringbuf.c	2012-07-02 14:06:48.000000000 +0200
+++ libcitadel-8.12/lib/stringbuf.c	2012-06-26 16:54:13.000000000 +0200
@@ -511,6 +511,7 @@
 
 	if (Siz == 0)
 	{
+		free(NewBuf);
 		return NULL;
 	}
 
@@ -611,7 +612,7 @@
  */
 int FlushStrBuf(StrBuf *buf)
 {
-	if (buf == NULL)
+	if ((buf == NULL) || (buf->buf == NULL))
 		return -1;
 	if (buf->ConstBuf)
 		return -1;       
@@ -815,7 +816,8 @@
  */
 void StrBufAppendBuf(StrBuf *Buf, const StrBuf *AppendBuf, unsigned long Offset)
 {
-	if ((AppendBuf == NULL) || (Buf == NULL) || (AppendBuf->buf == NULL))
+	if ((AppendBuf == NULL) || (AppendBuf->buf == NULL) ||
+	    (Buf == NULL) || (Buf->buf == NULL))
 		return;
 
 	if (Buf->BufSize - Offset < AppendBuf->BufUsed + Buf->BufUsed + 1)
@@ -1062,7 +1064,9 @@
  */
 void StrBufCutRight(StrBuf *Buf, int nChars)
 {
-	if ((Buf == NULL) || (Buf->BufUsed == 0)) return;
+	if ((Buf == NULL) || (Buf->BufUsed == 0) || (Buf->buf == NULL))
+		return;
+
 	if (nChars >= Buf->BufUsed) {
 		FlushStrBuf(Buf);
 		return;
@@ -1143,7 +1147,7 @@
 	const char *pLeft;
 	const char *pRight;
 
-	if (Buf == NULL)
+	if ((Buf == NULL) || (Buf->buf == NULL))
 		return;
 	pLeft = pBuff = Buf->buf;
 	while (pBuff != NULL) {
@@ -1341,6 +1345,23 @@
 	return ReducedBy;
 }
 
+int StrBufExtract_tokenFromStr(StrBuf *dest, const char *Source, long SourceLen, int parmnum, char separator)
+{
+	const StrBuf Temp = {
+		(char*)Source,
+		SourceLen,
+		SourceLen,
+		1
+#ifdef SIZE_DEBUG
+		,
+		0,
+		"",
+		""
+#endif
+	};
+
+	return StrBufExtract_token(dest, &Temp, parmnum, separator);
+}
 
 /**
  * @ingroup StrBuf_Tokenizer
@@ -2500,14 +2521,14 @@
 	int a, b, len;
 	char hex[3];
 
-	if (target != NULL)
-		FlushStrBuf(target);
-
-	if (source == NULL ||target == NULL)
+	if ((source == NULL) || (target == NULL) || (target->buf == NULL))
 	{
 		return;
 	}
 
+	if (target != NULL)
+		FlushStrBuf(target);
+
 	len = source->BufUsed;
 	for (a = 0; a < len; ++a) {
 		if (target->BufUsed >= target->BufSize)
@@ -2544,7 +2565,7 @@
 	if (target != NULL)
 		FlushStrBuf(target);
 
-	if (source == NULL ||target == NULL)
+	if ((source == NULL) || (target == NULL) || (target->buf == NULL))
 	{
 		return;
 	}
@@ -2732,7 +2753,10 @@
 			FlushStrBuf(*target);
 			StrBufAppendBuf(*target, source, 0);
 		}
-		return (*target)->BufUsed;
+		if (*target != 0)
+			return (*target)->BufUsed;
+		else
+			return 0;
 	}
 	if (*target == NULL)
 		*target = NewStrBufPlain(NULL, sizeof(headerStr) + source->BufUsed * 2);
@@ -2831,7 +2855,7 @@
 	while ((pch != NULL) && (pch < pche))
 	{
 		while (isspace(*pch)) pch++;
-		UserStart = UserEnd = EmailStart = EmailEnd = NULL;
+		UserEnd = EmailStart = EmailEnd = NULL;
 		
 		if ((*pch == '"') || (*pch == '\'')) {
 			UserStart = pch + 1;
@@ -2902,7 +2926,6 @@
 				EmailStart ++;
 				if (UserStart >= UserEnd)
 					UserStart = UserEnd = NULL;
-				At = strchr(EmailStart, '@');
 			}
 			else { /* this is a local recipient... no domain, just a realname */
 				EmailStart = UserStart;
@@ -3081,6 +3104,9 @@
 	size_t obuflen;			/**< Length of output buffer */
 
 
+	if ((ConvertBuf == NULL) || (TmpBuf == NULL))
+		return;
+
 	/* since we're converting to utf-8, one glyph may take up to 6 bytes */
 	if (ConvertBuf->BufUsed * 6 >= TmpBuf->BufSize)
 		IncreaseBuf(TmpBuf, 0, ConvertBuf->BufUsed * 6);
@@ -3263,9 +3289,12 @@
 #endif
 	const char *eptr;
 	int passes = 0;
-	int i, len;
+	int i;
 	int illegal_non_rfc2047_encoding = 0;
 
+
+	if (DecodeMe == NULL)
+		return;
 	/* Sometimes, badly formed messages contain strings which were simply
 	 *  written out directly in some foreign character set instead of
 	 *  using RFC2047 encoding.  This is illegal but we will attempt to
@@ -3273,7 +3302,6 @@
 	 *  charset to UTF-8 if we see any nonprintable characters.
 	 */
 	
-	len = StrLength(DecodeMe);
 	for (i=0; i<DecodeMe->BufUsed; ++i) {
 		if ((DecodeMe->buf[i] < 32) || (DecodeMe->buf[i] > 126)) {
 			illegal_non_rfc2047_encoding = 1;
@@ -3297,8 +3325,7 @@
 	}
 
 	/* pre evaluate the first pair */
-	nextend = end = NULL;
-	len = StrLength(DecodeMee);
+	end = NULL;
 	start = strstr(DecodeMee->buf, "=?");
 	eptr = DecodeMee->buf + DecodeMee->BufUsed;
 	if (start != NULL) 
@@ -3315,7 +3342,6 @@
 		
 		nFront = start - DecodeMee->buf;
 		StrBufAppendBufPlain(Target, DecodeMee->buf, nFront, 0);
-		len -= nFront;
 	}
 	/*
 	 * Since spammers will go to all sorts of absurd lengths to get their
@@ -3755,6 +3781,10 @@
 	const char *aptr, *ptr, *eptr;
 	char *optr, *xptr;
 
+	if ((FB == NULL) || (LineBuf == NULL) || (LineBuf->buf == NULL))
+		return eReadFail;
+	
+
 	if ((FB->Buf == NULL) || (FB->ReadWritePointer == StrBufNOTNULL)) {
 		FB->ReadWritePointer = StrBufNOTNULL;
 		return eReadFail;
@@ -3842,6 +3872,8 @@
 
 long IOBufferStrLength(IOBuffer *FB)
 {
+	if ((FB == NULL) || (FB->Buf == NULL))
+		return 0;
 	if (FB->ReadWritePointer == NULL)
 		return StrLength(FB->Buf);
 	
@@ -3854,7 +3886,7 @@
 	FDB->ChunkSize = 
 		FDB->TotalSendSize = TotalSendSize;
 	FDB->IOB = IO;
-#ifndef LINUX_SENDFILE
+#ifndef LINUX_SPLICE
 	FDB->ChunkBuffer = NewStrBufPlain(NULL, TotalSendSize + 1);
 #else
 	pipe(FDB->SplicePipe);
@@ -3877,21 +3909,43 @@
 
 int FileSendChunked(FDIOBuffer *FDB, const char **Err)
 {
-	char *pRead;
-	long nRead = 0;
-	
+	ssize_t sent, pipesize;
 #ifdef LINUX_SPLICE
-	ssize_t sent;
-	sent = sendfile(FDB->IOB->fd, FDB->OtherFD, &FDB->TotalSentAlready, FDB->ChunkSendRemain);
+	if (FDB->PipeSize == 0)
+	{
+		pipesize = splice(FDB->OtherFD,
+				  &FDB->TotalSentAlready, 
+				  FDB->SplicePipe[1],
+				  NULL, 
+				  FDB->ChunkSendRemain, 
+				  SPLICE_F_MOVE);
+	
+		if (pipesize == -1)
+		{
+			*Err = strerror(errno);
+			return pipesize;
+		}
+		FDB->PipeSize = pipesize;
+	}
+	sent =  splice(FDB->SplicePipe[0],
+		       NULL, 
+		       FDB->IOB->fd,
+		       NULL, 
+		       FDB->PipeSize,
+		       SPLICE_F_MORE | SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
 	if (sent == -1)
 	{
 		*Err = strerror(errno);
 		return sent;
 	}
+	FDB->PipeSize -= sent;
 	FDB->ChunkSendRemain -= sent;
-	FDB->TotalSentAlready += sent;
-	return FDB->ChunkSendRemain;
+	return sent;
 #else
+
+	char *pRead;
+	long nRead = 0;
+
 	pRead = FDB->ChunkBuffer->buf;
 	while ((FDB->ChunkBuffer->BufUsed < FDB->TotalSendSize) && (nRead >= 0))
 	{
@@ -3923,25 +3977,105 @@
 	ssize_t sent, pipesize;
 
 #ifdef LINUX_SPLICE
+	if (FDB->PipeSize == 0)
+	{
+		pipesize = splice(FDB->IOB->fd,
+				  NULL, 
+				  FDB->SplicePipe[1],
+				  NULL, 
+				  FDB->ChunkSendRemain, 
+				  SPLICE_F_MORE | SPLICE_F_MOVE|SPLICE_F_NONBLOCK);
 
-	pipesize = splice(FDB->IOB->fd, NULL, 
-			  FDB->SplicePipe[1], NULL, 
-			  FDB->ChunkSendRemain, 
-			  SPLICE_F_MORE | SPLICE_F_MOVE|SPLICE_F_NONBLOCK);
-	if (pipesize == -1)
+		if (pipesize == -1)
+		{
+			*Err = strerror(errno);
+			return pipesize;
+		}
+		FDB->PipeSize = pipesize;
+	}
+	
+	sent = splice(FDB->SplicePipe[0],
+		      NULL, 
+		      FDB->OtherFD,
+		      &FDB->TotalSentAlready, 
+		      FDB->PipeSize,
+		      SPLICE_F_MORE | SPLICE_F_MOVE);
+
+	if (sent == -1)
 	{
 		*Err = strerror(errno);
-		return pipesize;
+		return sent;
 	}
+	FDB->PipeSize -= sent;
+	FDB->ChunkSendRemain -= sent;
+	return sent;
+#else
 	
-	sent = splice(FDB->SplicePipe[0], NULL, 
-		      FDB->OtherFD, &FDB->TotalSentAlready, 
-		      pipesize, SPLICE_F_MORE | SPLICE_F_MOVE);
+	sent = read(FDB->IOB->fd, FDB->ChunkBuffer->buf, FDB->ChunkSendRemain);
+	if (sent > 0) {
+		int nWritten = 0;
+		int rc; 
+		
+		FDB->ChunkBuffer->BufUsed = sent;
+
+		while (nWritten < FDB->ChunkBuffer->BufUsed) {
+			rc =  write(FDB->OtherFD, FDB->ChunkBuffer->buf + nWritten, FDB->ChunkBuffer->BufUsed - nWritten);
+			if (rc < 0) {
+				*Err = strerror(errno);
+				return rc;
+			}
+			nWritten += rc;
+
+		}
+		FDB->ChunkBuffer->BufUsed = 0;
+		FDB->TotalSentAlready += sent;
+		FDB->ChunkSendRemain -= sent;
+		return FDB->ChunkSendRemain;
+	}
+	else if (sent < 0) {
+		*Err = strerror(errno);
+		return sent;
+	}
+
+#endif
+	return 0;
+}
+
+int FileMoveChunked(FDIOBuffer *FDB, const char **Err)
+{
+	ssize_t sent, pipesize;
+
+#ifdef LINUX_SPLICE
+	if (FDB->PipeSize == 0)
+	{
+		pipesize = splice(FDB->IOB->fd,
+				  &FDB->TotalReadAlready, 
+				  FDB->SplicePipe[1],
+				  NULL, 
+				  FDB->ChunkSendRemain, 
+				  SPLICE_F_MORE | SPLICE_F_MOVE|SPLICE_F_NONBLOCK);
+
+		if (pipesize == -1)
+		{
+			*Err = strerror(errno);
+			return pipesize;
+		}
+		FDB->PipeSize = pipesize;
+	}
+	
+	sent = splice(FDB->SplicePipe[0],
+		      NULL, 
+		      FDB->OtherFD,
+		      &FDB->TotalSentAlready, 
+		      FDB->PipeSize,
+		      SPLICE_F_MORE | SPLICE_F_MOVE);
+
 	if (sent == -1)
 	{
 		*Err = strerror(errno);
 		return sent;
 	}
+	FDB->PipeSize -= sent;
 	FDB->ChunkSendRemain -= sent;
 	return sent;
 #else
@@ -4055,6 +4189,11 @@
 {
 	int len, rlen, slen;
 
+	if ((buf == NULL) || (buf->buf == NULL)) {
+		*Error = strerror(EINVAL);
+		return -1;
+	}
+
 	if (!append)
 		FlushStrBuf(buf);
 
@@ -4398,7 +4537,7 @@
 	struct timeval tv;
 	fd_set rfds;
 
-	if ((Buf == NULL) || (*fd == -1))
+	if ((Buf == NULL) || (Buf->buf == NULL) || (*fd == -1))
 	{
 		*Error = ErrRBLF_BLOBPreConditionFailed;
 		return -1;
@@ -4480,8 +4619,7 @@
 {
 	const char *pos;
 	int fdflags;
-	int len = 0;
-	int rlen;
+	int rlen = 0;
 	int nRead = 0;
 	int nAlreadyRead = 0;
 	int IsNonBlock;
@@ -4507,8 +4645,8 @@
 	pos = *Pos;
 
 	if (pos != NULL)
-		len = pos - IOBuf->buf;
-	rlen = IOBuf->BufUsed - len;
+		rlen = pos - IOBuf->buf;
+	rlen = IOBuf->BufUsed - rlen;
 
 
 	if ((IOBuf->BufUsed > 0) && 
@@ -4542,8 +4680,6 @@
 		IncreaseBuf(IOBuf, 0, nBytes - nRead);
 	ptr = IOBuf->buf;
 
-	len = Blob->BufUsed;
-
 	fdflags = fcntl(*fd, F_GETFL);
 	IsNonBlock = (fdflags & O_NONBLOCK) == O_NONBLOCK;
 	if (IsNonBlock)
@@ -4640,7 +4776,11 @@
 	const char *aptr, *ptr, *eptr;
 	char *optr, *xptr;
 
-	if ((Buf == NULL) || (*Ptr == StrBufNOTNULL)) {
+	if ((Buf == NULL) ||
+	    (*Ptr == StrBufNOTNULL) ||
+	    (LineBuf == NULL)||
+	    (LineBuf->buf == NULL))
+	{
 		*Ptr = StrBufNOTNULL;
 		return 0;
 	}
diff -Nru libcitadel-8.11/lib/tools.c libcitadel-8.12/lib/tools.c
--- libcitadel-8.11/lib/tools.c	2012-05-22 16:58:19.000000000 +0200
+++ libcitadel-8.12/lib/tools.c	2012-06-26 16:54:13.000000000 +0200
@@ -387,7 +387,6 @@
 		dest[dpos++] = '\r';
 		dest[dpos++] = '\n';
 		dest[dpos] = 0;
-		thisline = 0;
 	}
 
 	return(dpos);
diff -Nru libcitadel-8.11/lib/vcard.c libcitadel-8.12/lib/vcard.c
--- libcitadel-8.11/lib/vcard.c	2012-05-22 16:58:19.000000000 +0200
+++ libcitadel-8.12/lib/vcard.c	2012-06-26 16:54:13.000000000 +0200
@@ -142,8 +142,6 @@
 
 	ptr = mycopy;
 	while (!IsEmptyStr(ptr)) {
-		colonpos = (-1);
-		nlpos = (-1);
 		colonpos = pattern2(ptr, ":");
 		nlpos = pattern2(ptr, "\n");
 
diff -Nru libcitadel-8.11/lib/wildfire.c libcitadel-8.12/lib/wildfire.c
--- libcitadel-8.11/lib/wildfire.c	2012-05-22 16:58:19.000000000 +0200
+++ libcitadel-8.12/lib/wildfire.c	2012-06-26 16:54:13.000000000 +0200
@@ -373,6 +373,7 @@
 	const char *Cat;
 	StrBuf *Header;
 
+	Header = NewStrBuf();
 	if (*MsgCount == 0) {
 		if (OutBuf != NULL) {
 			StrBufAppendBufPlain(OutBuf, 
@@ -392,7 +393,6 @@
 						     "http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1\r\n";), 0);
 		}
 		else {
-			Header = NewStrBuf();
 			AddHdr("X-Wf-Protocol-1", 
 			       "http://meta.wildfirehq.org/Protocol/JsonStream/0.2";);
 			AddHdr("X-Wf-1-Plugin-1",
diff -Nru libcitadel-8.11/sysdep.h.in libcitadel-8.12/sysdep.h.in
--- libcitadel-8.11/sysdep.h.in	2012-05-22 16:58:21.000000000 +0200
+++ libcitadel-8.12/sysdep.h.in	2012-06-26 16:54:15.000000000 +0200
@@ -57,6 +57,9 @@
 /* whether we have the linux sendfile api */
 #undef LINUX_SENDFILE
 
+/* whether we have the linux splice api */
+#undef LINUX_SPLICE
+
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
diff -Nru citadel-8.11/auth.c citadel-8.12/auth.c
--- citadel-8.11/auth.c	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/auth.c	2012-06-26 17:56:25.000000000 +0200
@@ -112,11 +112,12 @@
 	int retval = 0;
 	int flags = 0;
 
-	flags = 0;	/* silences compiler warning */
-
 #ifdef PAM_DATA_SILENT
-	flags = ( flags | PAM_DATA_SILENT ) ;
+	flags = PAM_DATA_SILENT;
+#else
+	flags = 0;
 #endif /* PAM_DATA_SILENT */
+
 	if ((pw = getpwuid(uid)) == NULL) {
 		return retval;
 	}
diff -Nru citadel-8.11/autom4te.cache/output.0 citadel-8.12/autom4te.cache/output.0
--- citadel-8.11/autom4te.cache/output.0	2012-05-22 17:14:52.000000000 +0200
+++ citadel-8.12/autom4te.cache/output.0	2012-06-26 17:56:30.000000000 +0200
@@ -1,7 +1,7 @@
 @%:@! /bin/sh
 @%:@ From configure.ac Revision: 5108 .
 @%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.67 for Citadel 8.11.
+@%:@ Generated by GNU Autoconf 2.67 for Citadel 8.12.
 @%:@
 @%:@ Report bugs to <http://www.citadel.org/>.
 @%:@ 
@@ -553,8 +553,8 @@
 # Identity of this package.
 PACKAGE_NAME='Citadel'
 PACKAGE_TARNAME='citadel'
-PACKAGE_VERSION='8.11'
-PACKAGE_STRING='Citadel 8.11'
+PACKAGE_VERSION='8.12'
+PACKAGE_STRING='Citadel 8.12'
 PACKAGE_BUGREPORT='http://www.citadel.org/'
 PACKAGE_URL=''
 
@@ -1265,7 +1265,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Citadel 8.11 to adapt to many kinds of systems.
+\`configure' configures Citadel 8.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1330,7 +1330,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Citadel 8.11:";;
+     short | recursive ) echo "Configuration of Citadel 8.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1448,7 +1448,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Citadel configure 8.11
+Citadel configure 8.12
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2106,7 +2106,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Citadel $as_me 8.11, which was
+It was created by Citadel $as_me 8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -8457,7 +8457,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Citadel $as_me 8.11, which was
+This file was extended by Citadel $as_me 8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8519,7 +8519,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Citadel config.status 8.11
+Citadel config.status 8.12
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff -Nru citadel-8.11/autom4te.cache/traces.0 citadel-8.12/autom4te.cache/traces.0
--- citadel-8.11/autom4te.cache/traces.0	2012-05-22 17:14:52.000000000 +0200
+++ citadel-8.12/autom4te.cache/traces.0	2012-06-26 17:56:30.000000000 +0200
@@ -1,6 +1,6 @@
 m4trace:aclocal.m4:110: -1- m4_include([m4/ucread.m4])
 m4trace:aclocal.m4:111: -1- m4_include([acinclude.m4])
-m4trace:configure.ac:3: -1- AC_INIT([Citadel], [8.11], [http://www.citadel.org/])
+m4trace:configure.ac:3: -1- AC_INIT([Citadel], [8.12], [http://www.citadel.org/])
 m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?A[CHUM]_])
 m4trace:configure.ac:3: -1- m4_pattern_forbid([_AC_])
 m4trace:configure.ac:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
diff -Nru citadel-8.11/citadel.h citadel-8.12/citadel.h
--- citadel-8.11/citadel.h	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/citadel.h	2012-06-26 17:56:25.000000000 +0200
@@ -45,10 +45,10 @@
  * usually more strict because you're not really supposed to dump/load and
  * upgrade at the same time.
  */
-#define REV_LEVEL	811		/* This version */
+#define REV_LEVEL	812		/* This version */
 #define REV_MIN		591		/* Oldest compatible database */
 #define EXPORT_REV_MIN	760		/* Oldest compatible export files */
-#define LIBCITADEL_MIN	811		/* Minimum required version of libcitadel */
+#define LIBCITADEL_MIN	812		/* Minimum required version of libcitadel */
 
 #define SERVER_TYPE 0			/* zero for stock Citadel; other developers please
 					   obtain SERVER_TYPE codes for your implementations */
diff -Nru citadel-8.11/configure citadel-8.12/configure
--- citadel-8.11/configure	2012-05-22 17:14:51.000000000 +0200
+++ citadel-8.12/configure	2012-06-26 17:56:29.000000000 +0200
@@ -1,7 +1,7 @@
 #! /bin/sh
 # From configure.ac Revision: 5108 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for Citadel 8.11.
+# Generated by GNU Autoconf 2.67 for Citadel 8.12.
 #
 # Report bugs to <http://www.citadel.org/>.
 #
@@ -553,8 +553,8 @@
 # Identity of this package.
 PACKAGE_NAME='Citadel'
 PACKAGE_TARNAME='citadel'
-PACKAGE_VERSION='8.11'
-PACKAGE_STRING='Citadel 8.11'
+PACKAGE_VERSION='8.12'
+PACKAGE_STRING='Citadel 8.12'
 PACKAGE_BUGREPORT='http://www.citadel.org/'
 PACKAGE_URL=''
 
@@ -1265,7 +1265,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Citadel 8.11 to adapt to many kinds of systems.
+\`configure' configures Citadel 8.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1330,7 +1330,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Citadel 8.11:";;
+     short | recursive ) echo "Configuration of Citadel 8.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1448,7 +1448,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Citadel configure 8.11
+Citadel configure 8.12
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2106,7 +2106,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Citadel $as_me 8.11, which was
+It was created by Citadel $as_me 8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -8457,7 +8457,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Citadel $as_me 8.11, which was
+This file was extended by Citadel $as_me 8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8519,7 +8519,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Citadel config.status 8.11
+Citadel config.status 8.12
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff -Nru citadel-8.11/configure.ac citadel-8.12/configure.ac
--- citadel-8.11/configure.ac	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/configure.ac	2012-06-26 17:56:25.000000000 +0200
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
-AC_INIT([Citadel], [8.11], [http://www.citadel.org/])
+AC_INIT([Citadel], [8.12], [http://www.citadel.org/])
 AC_REVISION([$Revision: 5108 $])
 AC_CONFIG_SRCDIR([citserver.c])
 AC_CONFIG_HEADER(sysdep.h)
diff -Nru citadel-8.11/database.c citadel-8.12/database.c
--- citadel-8.11/database.c	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/database.c	2012-06-26 17:56:25.000000000 +0200
@@ -725,12 +725,15 @@
 	if (tempcdb == NULL) {
 		syslog(LOG_EMERG, "cdb_fetch: Cannot allocate memory for tempcdb\n");
 		cdb_abort();
+		return NULL; /* make it easier for static analysis... */
+	}
+	else
+	{
+		tempcdb->len = dret.size;
+		tempcdb->ptr = dret.data;
+		cdb_decompress_if_necessary(tempcdb);
+		return (tempcdb);
 	}
-
-	tempcdb->len = dret.size;
-	tempcdb->ptr = dret.data;
-	cdb_decompress_if_necessary(tempcdb);
-	return (tempcdb);
 }
 
 
@@ -770,7 +773,7 @@
 
 	if (TSD->cursors[cdb] != NULL) {
 		syslog(LOG_EMERG,
-			"cdb_rewind: must close cursor on database %d before reopening.\n", cdb);
+		       "cdb_rewind: must close cursor on database %d before reopening.\n", cdb);
 		cdb_abort();
 		/* cclose(TSD->cursors[cdb]); */
 	}
diff -Nru citadel-8.11/debian/changelog citadel-8.12/debian/changelog
--- citadel-8.11/debian/changelog	2012-07-02 14:05:52.000000000 +0200
+++ citadel-8.12/debian/changelog	2012-07-02 14:05:52.000000000 +0200
@@ -1,3 +1,10 @@
+citadel (8.12-1) unstable; urgency=low
+
+  * Make sure curl version used is greater than 7.25.
+  * Imported Upstream version 8.12 (Closes: #676802)
+
+ -- Michael Meskes <meskes@debian.org>  Thu, 28 Jun 2012 10:46:25 +0200
+
 citadel (8.11-2) unstable; urgency=low
 
   * Repaired French translation. (Closes: #675553)
diff -Nru citadel-8.11/debian/citadel.init citadel-8.12/debian/citadel.init
--- citadel-8.11/debian/citadel.init	2012-07-02 14:05:52.000000000 +0200
+++ citadel-8.12/debian/citadel.init	2012-07-02 14:05:52.000000000 +0200
@@ -137,7 +137,11 @@
 		[ "$VERBOSE" != no ] && log_end_msg 0
 	fi
 	;;
-  restart|force-reload)
+  restart)
+	$0 stop
+	$0 start
+	;;
+  force-reload)
 	if test -n "$MODERN"; then
 	    log_daemon_msg "Restarting $DESC" "$NAME"
 	else
diff -Nru citadel-8.11/debian/citadel-server.postinst citadel-8.12/debian/citadel-server.postinst
--- citadel-8.11/debian/citadel-server.postinst	2012-07-02 14:05:52.000000000 +0200
+++ citadel-8.12/debian/citadel-server.postinst	2012-07-02 14:05:52.000000000 +0200
@@ -69,17 +69,23 @@
         export CREATE_INITTAB_ENTRY=no
         export NO_INIT_SCRIPTS=yes
 
-	if dpkg --compare-versions "$2" le 8.05-3; then
-		# older versions stop server in prerm
-		# so we may have to restart to make setup work
-		if ! test -S $RUNDIR/citadel.socket; then
-			invoke-rc.d citadel start || true
-			sleep 1
-		fi
-	fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
 
+if test x$1 = xconfigure; then
+	sleep 1
 	if test -S $RUNDIR/citadel-admin.socket; then
-        	echo "applying your settings."
+		echo "applying your settings."
 		/usr/lib/citadel-server/setup -q
 
 		# we're in a fresh install, so we send the welcome message.
@@ -107,17 +113,5 @@
 		    fi
 		fi
 	fi
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-#DEBHELPER#
-
+fi
 exit 0
diff -Nru citadel-8.11/debian/control citadel-8.12/debian/control
--- citadel-8.11/debian/control	2012-07-02 14:05:52.000000000 +0200
+++ citadel-8.12/debian/control	2012-07-02 14:05:52.000000000 +0200
@@ -5,8 +5,8 @@
 Uploaders: Wilfried Goesgens <w.goesgens@outgesourced.org>, Michael Meskes <meskes@debian.org>, Alexander Wirt <formorer@debian.org>
 Build-Depends: debhelper (>= 7.0.50~), po-debconf, bison, autotools-dev, 
  libdb-dev, libexpat1-dev, libical-dev (>=0.43), libldap2-dev, libncurses5-dev,
- libpam0g-dev, libsieve2-dev, libssl-dev, libcitadel-dev (>= 8.11),
- libcurl4-openssl-dev | libcurl3-openssl-dev, zlib1g-dev, libev-dev (>= 4.0), libc-ares-dev (>= 1.7.2)
+ libpam0g-dev, libsieve2-dev, libssl-dev, libcitadel-dev (>= 8.12),
+ libcurl4-openssl-dev (>> 7.25), zlib1g-dev, libev-dev (>= 4.0), libc-ares-dev (>= 1.7.2)
 Standards-Version: 3.9.3
 Vcs-Git: git://git.debian.org/git/pkg-citadel/citadel.git
 Vcs-Browser: http://git.debian.org/?p=pkg-citadel/citadel.git
diff -Nru citadel-8.11/event_client.c citadel-8.12/event_client.c
--- citadel-8.11/event_client.c	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/event_client.c	2012-06-26 17:56:25.000000000 +0200
@@ -309,7 +309,7 @@
 }
 
 
-void StopClientWatchers(AsyncIO *IO)
+void StopClientWatchers(AsyncIO *IO, int CloseFD)
 {
 	ev_timer_stop (event_base, &IO->rw_timeout);
 	ev_timer_stop(event_base, &IO->conn_fail);
@@ -320,11 +320,11 @@
 	ev_io_stop(event_base, &IO->send_event);
 	ev_io_stop(event_base, &IO->recv_event);
 
-	if (IO->SendBuf.fd != 0) {
+	if (CloseFD && (IO->SendBuf.fd > 0)) {
 		close(IO->SendBuf.fd);
+		IO->SendBuf.fd = -1;
+		IO->RecvBuf.fd = -1;
 	}
-	IO->SendBuf.fd = 0;
-	IO->RecvBuf.fd = 0;
 }
 
 void StopCurlWatchers(AsyncIO *IO)
@@ -352,7 +352,7 @@
 
 	EVM_syslog(LOG_DEBUG, "EVENT Terminating \n");
 
-	StopClientWatchers(IO);
+	StopClientWatchers(IO, 1);
 
 	if (IO->DNS.Channel != NULL) {
 		ares_destroy(IO->DNS.Channel);
@@ -495,8 +495,8 @@
 				StrBufPlain(IO->ErrMsg, errmsg, -1);
 			break;
 		default:
-			rc = StrBuf_write_one_chunk_callback(watcher->fd,
-							     0/*TODO*/,
+			rc = StrBuf_write_one_chunk_callback(IO->SendBuf.fd,
+							     0,
 							     &IO->SendBuf);
 		}
 
@@ -584,13 +584,25 @@
 		}
 	}
 	else if (rc < 0) {
-		IO_Timeout_callback(loop, &IO->rw_timeout, revents);
+		if (errno != EAGAIN) {
+			StopClientWatchers(IO, 1);
+			EV_syslog(LOG_DEBUG,
+				  "EVENT: Socket Invalid! [%d] [%s] [%d]\n",
+				  errno, strerror(errno), IO->SendBuf.fd);
+			StrBufPrintf(IO->ErrMsg,
+				     "Socket Invalid! [%s]",
+				     strerror(errno));
+			SetNextTimeout(IO, 0.0);
+		}
 	}
 	/* else : must write more. */
 }
 static void
 set_start_callback(struct ev_loop *loop, AsyncIO *IO, int revents)
 {
+	ev_timer_stop(event_base, &IO->conn_fail);
+	ev_timer_start(event_base, &IO->rw_timeout);
+
 	switch(IO->NextState) {
 	case eReadMore:
 	case eReadMessage:
@@ -722,7 +734,7 @@
                          (void*)&so_err,
                          &lon);
 
-        if ((err == 0) && (so_err == 111))
+        if ((err == 0) && (so_err != 0))
         {
                 EV_syslog(LOG_DEBUG, "connect() failed [%d][%s]\n",
                           so_err,
@@ -765,8 +777,8 @@
 		}
 		break;
 	default:
-		nbytes = StrBuf_read_one_chunk_callback(watcher->fd,
-							0 /*TODO */,
+		nbytes = StrBuf_read_one_chunk_callback(IO->RecvBuf.fd,
+							0,
 							&IO->RecvBuf);
 		break;
 	}
@@ -800,15 +812,20 @@
 	if (nbytes > 0) {
 		HandleInbound(IO);
 	} else if (nbytes == 0) {
-		IO_Timeout_callback(loop, &IO->rw_timeout, revents);
+		SetNextTimeout(IO, 0.0);
 		return;
 	} else if (nbytes == -1) {
-		// FD is gone. kick it. 
-		StopClientWatchers(IO);
-		EV_syslog(LOG_DEBUG,
-			  "EVENT: Socket Invalid! %s \n",
-			  strerror(errno));
-		ShutDownCLient(IO);
+		if (errno != EAGAIN) {
+			// FD is gone. kick it. 
+			StopClientWatchers(IO, 1);
+			EV_syslog(LOG_DEBUG,
+				  "EVENT: Socket Invalid! [%d] [%s] [%d]\n",
+				  errno, strerror(errno), IO->SendBuf.fd);
+			StrBufPrintf(IO->ErrMsg,
+				     "Socket Invalid! [%s]",
+				     strerror(errno));
+			SetNextTimeout(IO, 0.0);
+		}
 		return;
 	}
 }
@@ -948,7 +965,6 @@
 	if (rc >= 0){
 		EVM_syslog(LOG_DEBUG, "connect() immediate success.\n");
 		set_start_callback(event_base, IO, 0);
-		ev_timer_start(event_base, &IO->rw_timeout);
 		return IO->NextState;
 	}
 	else if (errno == EINPROGRESS) {
diff -Nru citadel-8.11/event_client.h citadel-8.12/event_client.h
--- citadel-8.11/event_client.h	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/event_client.h	2012-06-26 17:56:25.000000000 +0200
@@ -266,7 +266,7 @@
 
 void StopClient(AsyncIO *IO);
 
-void StopClientWatchers(AsyncIO *IO);
+void StopClientWatchers(AsyncIO *IO, int CloseFD);
 
 void SetNextTimeout(AsyncIO *IO, double timeout);
 
@@ -303,6 +303,9 @@
 		     IO_CallBack DBTerminate,
 		     IO_CallBack ShutdownAbort);
 
+void StopCurlWatchers(AsyncIO *IO);
+
+
 eNextState ReAttachIO(AsyncIO *IO,
 		      void *pData,
 		      int ReadFirst);
diff -Nru citadel-8.11/file_ops.c citadel-8.12/file_ops.c
--- citadel-8.11/file_ops.c	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/file_ops.c	2012-06-26 17:56:25.000000000 +0200
@@ -588,10 +588,15 @@
 	long start_pos;
 	size_t bytes;
 	char buf[SIZ];
+	int rc;
 
 	/* The client will transmit its requested offset and byte count */
 	start_pos = extract_long(cmdbuf, 0);
 	bytes = extract_int(cmdbuf, 1);
+	if ((start_pos < 0) || (bytes <= 0)) {
+		cprintf("%d you have to specify a value > 0.\n", ERROR + ILLEGAL_VALUE);
+		return;
+	}
 
 	if (CC->download_fp == NULL) {
 		cprintf("%d You don't have a download file open.\n",
@@ -604,7 +609,16 @@
 		bytes = sizeof(buf);
 	}
 
-	fseek(CC->download_fp, start_pos, 0);
+	rc = fseek(CC->download_fp, start_pos, 0);
+	if (rc < 0) {
+		cprintf("%d your file is smaller then %ld.\n", ERROR + ILLEGAL_VALUE, start_pos);
+		syslog(LOG_ALERT, "your file %s is smaller then %ld. [%s]\n", 
+		       CC->upl_path, 
+		       start_pos,
+		       strerror(errno));
+
+		return;
+	}
 	bytes = fread(buf, 1, bytes, CC->download_fp);
 	if (bytes > 0) {
 		/* Tell the client the actual byte count and transmit it */
@@ -634,6 +648,10 @@
 		cprintf("%d You don't have an upload file open.\n", ERROR + RESOURCE_NOT_OPEN);
 		return;
 	}
+	if (bytes <= 0) {
+		cprintf("%d you have to specify a value > 0.\n", ERROR + ILLEGAL_VALUE);
+		return;
+	}
 
 	if (bytes > 100000) {
 		bytes = 100000;
diff -Nru citadel-8.11/housekeeping.c citadel-8.12/housekeeping.c
--- citadel-8.11/housekeeping.c	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/housekeeping.c	2012-06-26 17:56:25.000000000 +0200
@@ -117,9 +117,9 @@
  * only allow housekeeping to execute once per minute, and we only allow one
  * instance to run at a time.
  */
+static int housekeeping_in_progress = 0;
+static time_t last_timer = 0L;
 void do_housekeeping(void) {
-	static int housekeeping_in_progress = 0;
-	static time_t last_timer = 0L;
 	int do_housekeeping_now = 0;
 	int do_perminute_housekeeping_now = 0;
 	time_t now;
@@ -133,11 +133,6 @@
 	if (housekeeping_in_progress == 0) {
 		do_housekeeping_now = 1;
 		housekeeping_in_progress = 1;
-		now = time(NULL);
-		if ( (now - last_timer) > (time_t)60 ) {
-			do_perminute_housekeeping_now = 1;
-			last_timer = time(NULL);
-		}
 	}
 	end_critical_section(S_HOUSEKEEPING);
 
@@ -150,6 +145,12 @@
 	 * loop.  Everything below this point is real work.
 	 */
 
+	now = time(NULL);
+	if ( (now - last_timer) > (time_t)60 ) {
+		do_perminute_housekeeping_now = 1;
+		last_timer = time(NULL);
+	}
+
 	/* First, do the "as often as needed" stuff... */
 	JournalRunQueue();
 	PerformSessionHooks(EVT_HOUSE);
@@ -163,5 +164,7 @@
 	/*
 	 * All done.
 	 */
+	begin_critical_section(S_HOUSEKEEPING);
 	housekeeping_in_progress = 0;
+	end_critical_section(S_HOUSEKEEPING);
 }
diff -Nru citadel-8.11/include/ctdl_module.h citadel-8.12/include/ctdl_module.h
--- citadel-8.11/include/ctdl_module.h	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/include/ctdl_module.h	2012-06-26 17:56:25.000000000 +0200
@@ -76,8 +76,32 @@
 /*
  * Hook functions available to modules.
  */
-
-void CtdlRegisterSessionHook(void (*fcn_ptr)(void), int EventType);
+/* Priorities for  */
+#define PRIO_QUEUE 500
+#define PRIO_AGGR 1000
+#define PRIO_SEND 1500
+#define PRIO_CLEANUP 2000
+/* Priorities for EVT_HOUSE */
+#define PRIO_HOUSE 3000
+/* Priorities for EVT_LOGIN */
+#define PRIO_CREATE 10000
+/* Priorities for EVT_LOGOUT */
+#define PRIO_LOGOUT 15000
+/* Priorities for EVT_LOGIN */
+#define PRIO_LOGIN 20000
+/* Priorities for EVT_START */
+#define PRIO_START 25000
+/* Priorities for EVT_STOP */
+#define PRIO_STOP 30000
+/* Priorities for EVT_ASYNC */
+#define PRIO_ASYNC 35000
+/* Priorities for EVT_SHUTDOWN */
+#define PRIO_SHUTDOWN 40000
+/* Priorities for EVT_UNSTEALTH */
+#define PRIO_UNSTEALTH 45000
+/* Priorities for EVT_STEALTH */
+#define PRIO_STEALTH 50000
+void CtdlRegisterSessionHook(void (*fcn_ptr)(void), int EventType, int Priority);
 void CtdlUnregisterSessionHook(void (*fcn_ptr)(void), int EventType);
 void CtdlShutdownServiceHooks(void);
 
diff -Nru citadel-8.11/internet_addressing.c citadel-8.12/internet_addressing.c
--- citadel-8.11/internet_addressing.c	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/internet_addressing.c	2012-06-26 17:56:25.000000000 +0200
@@ -608,7 +608,6 @@
 		snprintf(addr, sizeof addr, "%s@%s", user, node);
 		if (msg->cm_fields['A'] == NULL)
 			msg->cm_fields['A'] = strdup(name);
-		processed = 1;
 		if (msg->cm_fields['F'] == NULL)
 			msg->cm_fields['F'] = strdup(addr);
 		processed = 1;
diff -Nru citadel-8.11/journaling.c citadel-8.12/journaling.c
--- citadel-8.11/journaling.c	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/journaling.c	2012-06-26 17:56:25.000000000 +0200
@@ -130,6 +130,8 @@
 	static int seq = 0;
 	int i;
 
+	if (jmsg == NULL)
+		return;
 	journal_recps = validate_recipients(config.c_journal_dest, NULL, 0);
 	if (journal_recps != NULL) {
 
diff -Nru citadel-8.11/ldap.c citadel-8.12/ldap.c
--- citadel-8.11/ldap.c	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/ldap.c	2012-06-26 17:56:25.000000000 +0200
@@ -124,7 +124,8 @@
 	}
 
 	syslog(LOG_DEBUG, "LDAP search: %s\n", searchstring);
-	i = ldap_search_ext_s(ldserver,				/* ld				*/
+	(void) ldap_search_ext_s(
+		ldserver,					/* ld				*/
 		config.c_ldap_base_dn,				/* base				*/
 		LDAP_SCOPE_SUBTREE,				/* scope			*/
 		searchstring,					/* filter			*/
diff -Nru citadel-8.11/locate_host.c citadel-8.12/locate_host.c
--- citadel-8.11/locate_host.c	2012-05-22 17:14:46.000000000 +0200
+++ citadel-8.12/locate_host.c	2012-06-26 17:56:25.000000000 +0200
@@ -146,7 +146,7 @@
 		if( len == -1 ) {
 			if (txtbuf != NULL) {
 				snprintf(txtbuf, txtbufsize,
-					"Message rejected due to known spammer source IP address");
+					 "Message rejected due to known spammer source IP address");
 			}
 			if (need_to_free_answer) free(answer);
 			return(1);
@@ -184,7 +184,7 @@
 	{
 		if (txtbuf != NULL) {
 			snprintf(txtbuf, txtbufsize,
-				"Message rejected due to known spammer source IP address");
+				 "Message rejected due to known spammer source IP address");
 		}
 		if (need_to_free_answer) free(answer);
 		free(result);
@@ -235,11 +235,17 @@
 	}
 	*rp = '\0';
 	if (txtbuf != NULL) {
-		snprintf(txtbuf, txtbufsize, "%s", result);
-	}
-	/* Remove nonprintable characters */
-	for (p=txtbuf; *p; ++p) {
-		if (!isprint(*p)) strcpy(p, p+1);
+		long len;
+		len = snprintf(txtbuf, txtbufsize, "%s", result);
+	
+		/* Remove nonprintable characters */
+		for (p = txtbuf; *p != '\0'; p++) {
+			if (!isprint(*p)) {
+				memmove (p,
+					 p + 1,
+					 len - (p - txtbuf) - 1);
+			}
+		}
 	}
 	if (need_to_free_answer) free(answer);
 	free(result);
diff -Nru citadel-8.11/modules/calendar/serv_calendar.c citadel-8.12/modules/calendar/serv_calendar.c
--- citadel-8.11/modules/calendar/serv_calendar.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/calendar/serv_calendar.c	2012-06-26 17:56:25.000000000 +0200
@@ -986,6 +986,9 @@
 		}
 		dur = icaltime_subtract(t2end, t2start);
 	}
+	else {
+		memset (&dur, 0, sizeof(struct icaldurationtype));
+	}
 
 	rrule = ical_ctdl_get_subprop(existing_event, ICAL_RRULE_PROPERTY);
 	if (rrule) {
@@ -1043,8 +1046,6 @@
 		long existing_msgnum)
 {
 	struct icaltimetype t1start, t1end;
-	t1start = icaltime_null_time();
-	t1end = icaltime_null_time();
 	icalproperty *p;
 	char compare_uid[SIZ];
 
@@ -1056,13 +1057,17 @@
 	int num_recur = 0;
 
 	/* initialization */
-	strcpy(compare_uid, "");
+	t1end = icaltime_null_time();
+	*compare_uid = '\0';
 
 	/* proposed event stuff */
 
 	p = ical_ctdl_get_subprop(proposed_event, ICAL_DTSTART_PROPERTY);
-	if (p == NULL) return;
-	if (p != NULL) t1start = icalproperty_get_dtstart(p);
+	if (p == NULL)
+		return;
+	else
+		t1start = icalproperty_get_dtstart(p);
+
 	if (icaltime_is_utc(t1start)) {
 		t1start.zone = icaltimezone_get_utc_timezone();
 	}
@@ -1097,6 +1102,9 @@
 
 		dur = icaltime_subtract(t1end, t1start);
 	}
+	else {
+		memset (&dur, 0, sizeof(struct icaldurationtype));
+	}
 
 	rrule = ical_ctdl_get_subprop(proposed_event, ICAL_RRULE_PROPERTY);
 	if (rrule) {
@@ -1244,8 +1252,8 @@
 	icalproperty *p;
 	icalvalue *v;
 	struct icalperiodtype this_event_period = icalperiodtype_null_period();
-	icaltimetype dtstart = icaltime_null_time();
-	icaltimetype dtend = icaltime_null_time();
+	icaltimetype dtstart;
+	icaltimetype dtend;
 
 	/* recur variables */
 	icalproperty *rrule = NULL;
@@ -1298,6 +1306,9 @@
 	if (!icaltime_is_null_time(dtend)) {
 		dur = icaltime_subtract(dtend, dtstart);
 	}
+	else {
+		memset (&dur, 0, sizeof(struct icaldurationtype));
+	}
 
 	/* Is a recurrence specified?  If so, get ready to process it... */
 	rrule = ical_ctdl_get_subprop(cal, ICAL_RRULE_PROPERTY);
@@ -2589,10 +2600,10 @@
 		/* Initialize our hook functions */
 		CtdlRegisterMessageHook(ical_obj_beforesave, EVT_BEFORESAVE);
 		CtdlRegisterMessageHook(ical_obj_aftersave, EVT_AFTERSAVE);
-		CtdlRegisterSessionHook(ical_CtdlCreateRoom, EVT_LOGIN);
+		CtdlRegisterSessionHook(ical_CtdlCreateRoom, EVT_LOGIN, PRIO_LOGIN + 1);
 		CtdlRegisterProtoHook(cmd_ical, "ICAL", "Citadel iCal commands");
-		CtdlRegisterSessionHook(ical_session_startup, EVT_START);
-		CtdlRegisterSessionHook(ical_session_shutdown, EVT_STOP);
+		CtdlRegisterSessionHook(ical_session_startup, EVT_START, PRIO_START + 1);
+		CtdlRegisterSessionHook(ical_session_shutdown, EVT_STOP, PRIO_STOP + 80);
 		CtdlRegisterFixedOutputHook("text/calendar", ical_fixed_output);
 		CtdlRegisterFixedOutputHook("application/ics", ical_fixed_output);
 		CtdlRegisterCleanupHook(serv_calendar_destroy);
diff -Nru citadel-8.11/modules/checkpoint/serv_checkpoint.c citadel-8.12/modules/checkpoint/serv_checkpoint.c
--- citadel-8.11/modules/checkpoint/serv_checkpoint.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/checkpoint/serv_checkpoint.c	2012-06-26 17:56:25.000000000 +0200
@@ -61,7 +61,7 @@
 CTDL_MODULE_INIT(checkpoint) {
 	if (threading)
 	{
-		CtdlRegisterSessionHook(cdb_checkpoint, EVT_TIMER);
+		CtdlRegisterSessionHook(cdb_checkpoint, EVT_TIMER, PRIO_CLEANUP + 10);
 	}
 	/* return our module name for the log */
 	return "checkpoint";
diff -Nru citadel-8.11/modules/crypto/serv_crypto.c citadel-8.12/modules/crypto/serv_crypto.c
--- citadel-8.11/modules/crypto/serv_crypto.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/crypto/serv_crypto.c	2012-06-26 17:56:25.000000000 +0200
@@ -385,7 +385,7 @@
 	CtdlRegisterProtoHook(cmd_stls, "STLS", "Start SSL/TLS session");
 	CtdlRegisterProtoHook(cmd_gtls, "GTLS",
 			      "Get SSL/TLS session status");
-	CtdlRegisterSessionHook(endtls, EVT_STOP);
+	CtdlRegisterSessionHook(endtls, EVT_STOP, PRIO_STOP + 10);
 }
 
 
@@ -497,7 +497,7 @@
 			StrBufAppendBufPlain(Line, pos, 
 					     StrLength(IOBuf) - (pos - ChrPtr(IOBuf)), 0);
 			FlushStrBuf(IOBuf);
-			pos = *Pos = NULL;
+			*Pos = NULL;
 		}
 		else {
 			int n = 0;
@@ -510,7 +510,7 @@
 
 			if (StrLength(IOBuf) <= (pch - ChrPtr(IOBuf) + 1)) {
 				FlushStrBuf(IOBuf);
-				pos = *Pos = NULL;
+				*Pos = NULL;
 			}
 			else 
 				*Pos = pch + 1;
diff -Nru citadel-8.11/modules/eventclient/serv_eventclient.c citadel-8.12/modules/eventclient/serv_eventclient.c
--- citadel-8.11/modules/eventclient/serv_eventclient.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/eventclient/serv_eventclient.c	2012-06-26 17:56:25.000000000 +0200
@@ -316,10 +316,10 @@
 	if (IO == NULL) {
 		sta = curl_easy_getinfo(easy, CURLINFO_PRIVATE, &f);
 		if (sta) {
-			EVCURL_syslog(LOG_ERR,
-				      "EVCURL: error asking curl for private "
-				      "cookie of curl handle: %s\n",
-				      curl_easy_strerror(sta));
+			CURL_syslog(LOG_ERR,
+				    "EVCURL: error asking curl for private "
+				    "cookie of curl handle: %s\n",
+				    curl_easy_strerror(sta));
 			return -1;
 		}
 		IO = (AsyncIO *) f;
diff -Nru citadel-8.11/modules/expire/serv_expire.c citadel-8.12/modules/expire/serv_expire.c
--- citadel-8.11/modules/expire/serv_expire.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/expire/serv_expire.c	2012-06-26 17:56:25.000000000 +0200
@@ -706,15 +706,18 @@
 	cdb_rewind(CDB_USETABLE);
 	while(cdbut = cdb_next_item(CDB_USETABLE), cdbut != NULL) {
 
-	/*
-	 * TODODRW: change this to create a new function time_t cdb_get_timestamp( struct cdbdata *)
-	 * this will release this file from the serv_network.h
-	 * Maybe it could be a macro that extracts and casts the reult
-	 */
-	       memcpy(&ut, cdbut->ptr,
-		     ((cdbut->len > sizeof(struct UseTable)) ?
-		      sizeof(struct UseTable) : cdbut->len));
-	       cdb_free(cdbut);
+		/*
+		 * TODODRW: change this to create a new function time_t cdb_get_timestamp( struct cdbdata *)
+		 * this will release this file from the serv_network.h
+		 * Maybe it could be a macro that extracts and casts the reult
+		 */
+		if (cdbut->len > sizeof(struct UseTable))
+			memcpy(&ut, cdbut->ptr, sizeof(struct UseTable));
+		else {
+			memset(&ut, 0, sizeof(struct UseTable));
+			memcpy(&ut, cdbut->ptr, cdbut->len);
+		}
+		cdb_free(cdbut);
 
 		if ( (time(NULL) - ut.ut_timestamp) > USETABLE_RETAIN ) {
 			uptr = (struct UPurgeList *) malloc(sizeof(struct UPurgeList));
@@ -948,7 +951,7 @@
 		CtdlRegisterProtoHook(cmd_tdap, "TDAP", "Manually initiate auto-purger");
 		CtdlRegisterProtoHook(cmd_gpex, "GPEX", "Get expire policy");
 		CtdlRegisterProtoHook(cmd_spex, "SPEX", "Set expire policy");
-		CtdlRegisterSessionHook(purge_databases, EVT_TIMER);
+		CtdlRegisterSessionHook(purge_databases, EVT_TIMER, PRIO_CLEANUP + 20);
 	}
 
 	/* return our module name for the log */
diff -Nru citadel-8.11/modules/extnotify/extnotify_main.c citadel-8.12/modules/extnotify/extnotify_main.c
--- citadel-8.11/modules/extnotify/extnotify_main.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/extnotify/extnotify_main.c	2012-06-26 17:56:25.000000000 +0200
@@ -471,7 +471,7 @@
 	if (!threading)
 	{
 		create_extnotify_queue();
-		CtdlRegisterSessionHook(do_extnotify_queue, EVT_TIMER);
+		CtdlRegisterSessionHook(do_extnotify_queue, EVT_TIMER, PRIO_SEND + 10);
 	}
 	/* return our module name for the log */
 	return "extnotify";
diff -Nru citadel-8.11/modules/extnotify/funambol65.c citadel-8.12/modules/extnotify/funambol65.c
--- citadel-8.11/modules/extnotify/funambol65.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/extnotify/funambol65.c	2012-06-26 17:56:25.000000000 +0200
@@ -93,11 +93,15 @@
 
 	if (tlen > 0) {
 		/* Load the template message. Get mallocs done too */
-		FILE *Ftemplate = NULL;
+		int fd;
+		struct stat statbuf;
 		const char *mimetype;
+		const char *Err = NULL;
 
-		Ftemplate = fopen(template, "r");
-		if (Ftemplate == NULL) {
+		fd = open(template, O_RDONLY);
+		if ((fd < 0) ||
+		    (fstat(fd, &statbuf) == -1))
+		{
 			char buf[SIZ];
 
 			snprintf(buf, SIZ,
@@ -110,34 +114,35 @@
 			CtdlAideMessage(
 				buf,
 				"External notifier: "
-				"unable to find message template!");
+				"unable to find/stat message template!");
 			goto abort;
 		}
-		mimetype = GuessMimeByFilename(template, tlen);
-
-		buf = malloc(SIZ);
-		memset(buf, 0, SIZ);
-		SOAPMessage = malloc(3072);
-		memset(SOAPMessage, 0, 3072);
 
-		while(fgets(buf, SIZ, Ftemplate) != NULL) {
-			strcat(SOAPMessage, buf);
-		}
-		fclose(Ftemplate);
-
-		if (strlen(SOAPMessage) < 0) {
+		Buf = NewStrBufPlain(NULL, statbuf.st_size + 1);
+		if (StrBufReadBLOB(Buf, &fd, 1, statbuf.st_size, &Err) < 0) {
 			char buf[SIZ];
 
+			close(fd);
+
 			snprintf(buf, SIZ,
-				 "Cannot load template file %s;"
-				 " won't send notification\r\n",
-				 file_funambol_msg);
+				 "Cannot load template file %s [%s] "
+				 "won't send notification\r\n",
+				 file_funambol_msg,
+				 Err);
 			syslog(LOG_ERR, "%s", buf);
-
-			CtdlAideMessage(buf, "External notifier: "
-					"unable to load message template!");
+			// TODO: once an hour!
+			CtdlAideMessage(
+				buf,
+				"External notifier: "
+				"unable to load message template!");
 			goto abort;
 		}
+		close(fd);
+
+		mimetype = GuessMimeByFilename(template, tlen);
+
+		SOAPMessage = SmashStrBuf(&Buf);
+
 		// Do substitutions
 		help_subst(SOAPMessage, "^notifyuser", user);
 		help_subst(SOAPMessage, "^syncsource",
@@ -159,7 +164,8 @@
 		IO->HttpReq.headers = curl_slist_append(
 			IO->HttpReq.headers,
 			contenttype);
-
+		free(contenttype);
+		contenttype = NULL;
 		IO->HttpReq.headers = curl_slist_append(
 			IO->HttpReq.headers,
 			"Accept: application/soap+xml, "
diff -Nru citadel-8.11/modules/fulltext/serv_fulltext.c citadel-8.12/modules/fulltext/serv_fulltext.c
--- citadel-8.11/modules/fulltext/serv_fulltext.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/fulltext/serv_fulltext.c	2012-06-26 17:56:25.000000000 +0200
@@ -415,28 +415,29 @@
 
 		}
 		free(tokens);
-		qsort(all_msgs, num_all_msgs, sizeof(long), longcmp);
+		if (all_msgs != NULL) {
+			qsort(all_msgs, num_all_msgs, sizeof(long), longcmp);
 
-		/*
-		 * At this point, if a message appears num_tokens times in the
-		 * list, then it contains all of the search tokens.
-		 */
-		if (num_all_msgs >= num_tokens)
-		   for (j=0; j<(num_all_msgs-num_tokens+1); ++j) {
-			if (all_msgs[j] == all_msgs[j+num_tokens-1]) {
-
-				++num_ret_msgs;
-				if (num_ret_msgs > num_ret_alloc) {
-					num_ret_alloc += 64;
-					ret_msgs = realloc(ret_msgs,
-						(num_ret_alloc*sizeof(long)) );
+			/*
+			 * At this point, if a message appears num_tokens times in the
+			 * list, then it contains all of the search tokens.
+			 */
+			if (num_all_msgs >= num_tokens)
+				for (j=0; j<(num_all_msgs-num_tokens+1); ++j) {
+					if (all_msgs[j] == all_msgs[j+num_tokens-1]) {
+						
+						++num_ret_msgs;
+						if (num_ret_msgs > num_ret_alloc) {
+							num_ret_alloc += 64;
+							ret_msgs = realloc(ret_msgs,
+									   (num_ret_alloc*sizeof(long)) );
+						}
+						ret_msgs[num_ret_msgs - 1] = all_msgs[j];
+						
+					}
 				}
-				ret_msgs[num_ret_msgs - 1] = all_msgs[j];
-
-			}
+			free(all_msgs);
 		}
-
-		free(all_msgs);
 	}
 
 	*fts_num_msgs = num_ret_msgs;
@@ -506,7 +507,7 @@
 		CtdlRegisterDeleteHook(ft_delete_remove);
 		CtdlRegisterSearchFuncHook(ft_search, "fulltext");
 		CtdlRegisterCleanupHook(noise_word_cleanup);
-		CtdlRegisterSessionHook(do_fulltext_indexing, EVT_TIMER);
+		CtdlRegisterSessionHook(do_fulltext_indexing, EVT_TIMER, PRIO_CLEANUP + 300);
 	}
 	/* return our module name for the log */
 	return "fulltext";
diff -Nru citadel-8.11/modules/imap/imap_fetch.c citadel-8.12/modules/imap/imap_fetch.c
--- citadel-8.11/modules/imap/imap_fetch.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/imap/imap_fetch.c	2012-06-26 17:56:25.000000000 +0200
@@ -209,8 +209,6 @@
 	 * intervening blank line to be part of the headers, not the text.
 	 */
 	headers_size = 0;
-	text_size = 0;
-	total_size = 0;
 
 	if (need_body) {
 		StrBuf *Line = NewStrBuf();
@@ -604,7 +602,7 @@
 		StrBufSipLine(Line, CCC->redirect_buffer, &Ptr);
 
 		if (!isspace(ChrPtr(Line)[0])) {
-			ok = 0;
+
 			if (doing_headers == 0) ok = 1;
 			else {
 				/* we're supposed to print all headers that are not matching the filter list */
diff -Nru citadel-8.11/modules/imap/imap_tools.c citadel-8.12/modules/imap/imap_tools.c
--- citadel-8.11/modules/imap/imap_tools.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/imap/imap_tools.c	2012-06-26 17:56:25.000000000 +0200
@@ -569,13 +569,13 @@
 	if (qrbuf->QRflags & QR_MAILBOX)
 	{
 		if (strcasecmp(qrbuf->QRname+11, MAILROOM) == 0)
-			p = toimap(p, bufend, "INBOX");
+			toimap(p, bufend, "INBOX");
 		else
 		{
 			p = toimap(p, bufend, "INBOX");
 			if (p < bufend)
 				*p++ = '/';
-			p = toimap(p, bufend, qrbuf->QRname+11);
+			toimap(p, bufend, qrbuf->QRname+11);
 		}
 	}
 	else
@@ -586,7 +586,7 @@
 		p = toimap(p, bufend, fl->f_name);
 		if (p < bufend)
 			*p++ = '/';
-		p = toimap(p, bufend, qrbuf->QRname);
+		toimap(p, bufend, qrbuf->QRname);
 	}
 }
 
@@ -840,7 +840,10 @@
 				}
 				return WILDMAT_TRUE;
 			}
-			while (!IsEmptyStr(text) && (*(text - 1) != WILDMAT_DELIM)) {
+			while (!IsEmptyStr(text) &&
+			       /* make shure texst - 1 isn't before lcase_p */
+			       ((text == lcase_text) || (*(text - 1) != WILDMAT_DELIM)))
+			{
 				if ((matched = do_imap_match(text++, p))
 				   != WILDMAT_FALSE) {
 					return matched;
diff -Nru citadel-8.11/modules/imap/serv_imap.c citadel-8.12/modules/imap/serv_imap.c
--- citadel-8.11/modules/imap/serv_imap.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/imap/serv_imap.c	2012-06-26 17:56:25.000000000 +0200
@@ -1721,7 +1721,7 @@
 		CtdlRegisterServiceHook(config.c_imaps_port,
 					NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS);
 #endif
-		CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP);
+		CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP, PRIO_STOP + 30);
 		CtdlRegisterCleanupHook(imap_cleanup);
 	}
 	
diff -Nru citadel-8.11/modules/instmsg/serv_instmsg.c citadel-8.12/modules/instmsg/serv_instmsg.c
--- citadel-8.11/modules/instmsg/serv_instmsg.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/instmsg/serv_instmsg.c	2012-06-26 17:56:25.000000000 +0200
@@ -599,11 +599,11 @@
 		CtdlRegisterProtoHook(cmd_sexp, "SEXP", "Send an instant message");
 		CtdlRegisterProtoHook(cmd_dexp, "DEXP", "Disable instant messages");
 		CtdlRegisterProtoHook(cmd_reqt, "REQT", "Request client termination");
-		CtdlRegisterSessionHook(cmd_gexp_async, EVT_ASYNC);
-		CtdlRegisterSessionHook(delete_instant_messages, EVT_STOP);
+		CtdlRegisterSessionHook(cmd_gexp_async, EVT_ASYNC, PRIO_ASYNC + 1);
+		CtdlRegisterSessionHook(delete_instant_messages, EVT_STOP, PRIO_STOP + 1);
 		CtdlRegisterXmsgHook(send_instant_message, XMSG_PRI_LOCAL);
-		CtdlRegisterSessionHook(instmsg_timer, EVT_TIMER);
-		CtdlRegisterSessionHook(instmsg_shutdown, EVT_SHUTDOWN);
+		CtdlRegisterSessionHook(instmsg_timer, EVT_TIMER, PRIO_CLEANUP + 400);
+		CtdlRegisterSessionHook(instmsg_shutdown, EVT_SHUTDOWN, PRIO_SHUTDOWN + 10);
 	}
 	
 	/* return our module name for the log */
diff -Nru citadel-8.11/modules/managesieve/serv_managesieve.c citadel-8.12/modules/managesieve/serv_managesieve.c
--- citadel-8.11/modules/managesieve/serv_managesieve.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/managesieve/serv_managesieve.c	2012-06-26 17:56:25.000000000 +0200
@@ -666,7 +666,7 @@
 					managesieve_command_loop,
 					NULL, 
 					CitadelServiceManageSieve);
-		CtdlRegisterSessionHook(managesieve_cleanup_function, EVT_STOP);
+		CtdlRegisterSessionHook(managesieve_cleanup_function, EVT_STOP, PRIO_STOP + 30);
 	}
 	
 	/* return our module name for the log */
diff -Nru citadel-8.11/modules/network/netconfig.h citadel-8.12/modules/network/netconfig.h
--- citadel-8.11/modules/network/netconfig.h	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/network/netconfig.h	2012-06-26 17:56:25.000000000 +0200
@@ -1,13 +1,54 @@
-typedef struct NetMap NetMap;
+/*
+ * This module handles shared rooms, inter-Citadel mail, and outbound
+ * mailing list processing.
+ *
+ * Copyright (c) 2000-2012 by the citadel.org team
+ *
+ *  This program is open source software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * ** NOTE **   A word on the S_NETCONFIGS semaphore:
+ * This is a fairly high-level type of critical section.  It ensures that no
+ * two threads work on the netconfigs files at the same time.  Since we do
+ * so many things inside these, here are the rules:
+ *  1. begin_critical_section(S_NETCONFIGS) *before* begin_ any others.
+ *  2. Do *not* perform any I/O with the client during these sections.
+ *
+ */
 
-struct  NetMap {
-	NetMap *next;
-	char nodename[SIZ];
+typedef struct _nodeconf {
+	int DeleteMe;
+	StrBuf *NodeName;
+	StrBuf *Secret;
+	StrBuf *Host;
+	StrBuf *Port;
+}NodeConf;
+
+typedef struct __NetMap {
+	StrBuf *NodeName;
 	time_t lastcontact;
-	char nexthop[SIZ];
-};
+	StrBuf *NextHop;
+}NetMap;
+
+HashList* load_ignetcfg(void);
+
+HashList* read_network_map(void);
+StrBuf *SerializeNetworkMap(HashList *Map);
+void network_learn_topology(char *node, char *path, HashList *the_netmap, int *netmap_changed);
 
-char* load_working_ignetcfg(void);
-NetMap *read_network_map(void);
-void write_network_map(NetMap *the_netmap, int netmap_changed);
-int is_valid_node(char *nexthop, char *secret, char *node, char *working_ignetcfg, NetMap *the_netmap);
+int is_valid_node(const StrBuf **nexthop,
+		  const StrBuf **secret,
+		  StrBuf *node,
+		  HashList *IgnetCfg,
+		  HashList *the_netmap);
diff -Nru citadel-8.11/modules/network/netspool.h citadel-8.12/modules/network/netspool.h
--- citadel-8.11/modules/network/netspool.h	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/network/netspool.h	2012-06-26 17:56:25.000000000 +0200
@@ -1,3 +1,32 @@
+/*
+ * This module handles shared rooms, inter-Citadel mail, and outbound
+ * mailing list processing.
+ *
+ * Copyright (c) 2000-2012 by the citadel.org team
+ *
+ *  This program is open source software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * ** NOTE **   A word on the S_NETCONFIGS semaphore:
+ * This is a fairly high-level type of critical section.  It ensures that no
+ * two threads work on the netconfigs files at the same time.  Since we do
+ * so many things inside these, here are the rules:
+ *  1. begin_critical_section(S_NETCONFIGS) *before* begin_ any others.
+ *  2. Do *not* perform any I/O with the client during these sections.
+ *
+ */
+
 typedef struct maplist maplist;
 
 struct maplist {
@@ -19,16 +48,16 @@
 	FILE *digestfp;
 	int num_msgs_spooled;
 
-	char *working_ignetcfg;
-	NetMap *the_netmap;
+	HashList *working_ignetcfg;
+	HashList *the_netmap;
 };
 
 
 void network_spoolout_room(RoomProcList *room_to_spool, 		       
-			   char *working_ignetcfg,
-			   NetMap *the_netmap);
-void network_do_spoolin(char *working_ignetcfg, NetMap **the_netmap, int *netmap_changed);
-void network_consolidate_spoolout(char *working_ignetcfg, NetMap *the_netmap);
+			   HashList *working_ignetcfg,
+			   HashList *the_netmap);
+void network_do_spoolin(HashList *working_ignetcfg, HashList *the_netmap, int *netmap_changed);
+void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netmap);
 void free_spoolcontrol_struct(SpoolControl **scc);
 int writenfree_spoolcontrol_file(SpoolControl **scc, char *filename);
 int read_spoolcontrol_file(SpoolControl **scc, char *filename);
diff -Nru citadel-8.11/modules/network/serv_netconfig.c citadel-8.12/modules/network/serv_netconfig.c
--- citadel-8.11/modules/network/serv_netconfig.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/network/serv_netconfig.c	2012-06-26 17:56:25.000000000 +0200
@@ -2,7 +2,7 @@
  * This module handles shared rooms, inter-Citadel mail, and outbound
  * mailing list processing.
  *
- * Copyright (c) 2000-2011 by the citadel.org team
+ * Copyright (c) 2000-2012 by the citadel.org team
  *
  *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -92,165 +92,268 @@
 #include "ctdl_module.h"
 
 
+
+void DeleteNodeConf(void *vNode)
+{
+	NodeConf *Node = (NodeConf*) vNode;
+	FreeStrBuf(&Node->NodeName);
+	FreeStrBuf(&Node->Secret);
+	FreeStrBuf(&Node->Host);
+	FreeStrBuf(&Node->Port);
+	free(Node);
+}
+
+NodeConf *NewNode(StrBuf *SerializedNode)
+{
+	const char *Pos = NULL;
+	NodeConf *Node;
+
+	/* we need at least 4 pipes and some other text so its invalid. */
+	if (StrLength(SerializedNode) < 8)
+		return NULL;
+	Node = (NodeConf *) malloc(sizeof(NodeConf));
+
+	Node->DeleteMe = 0;
+
+	Node->NodeName=NewStrBuf();
+	StrBufExtract_NextToken(Node->NodeName, SerializedNode, &Pos, '|');
+
+	Node->Secret=NewStrBuf();
+	StrBufExtract_NextToken(Node->Secret, SerializedNode, &Pos, '|');
+
+	Node->Host=NewStrBuf();
+	StrBufExtract_NextToken(Node->Host, SerializedNode, &Pos, '|');
+
+	Node->Port=NewStrBuf();
+	StrBufExtract_NextToken(Node->Port, SerializedNode, &Pos, '|');
+	return Node;
+}
+
+
 /*
  * Load or refresh the Citadel network (IGnet) configuration for this node.
  */
-char* load_working_ignetcfg(void) {
-	return CtdlGetSysConfig(IGNETCFG);
+HashList* load_ignetcfg(void)
+{
+	const char *LinePos;
+	char       *Cfg;
+	StrBuf     *Buf;
+	StrBuf     *LineBuf;
+	HashList   *Hash;
+	NodeConf   *Node;
+
+	Cfg =  CtdlGetSysConfig(IGNETCFG);
+	if ((Cfg == NULL) || IsEmptyStr(Cfg)) {
+		if (Cfg != NULL)
+			free(Cfg);
+		return NULL;
+	}
+
+	Hash = NewHash(1, NULL);
+	Buf = NewStrBufPlain(Cfg, -1);
+	free(Cfg);
+	LineBuf = NewStrBufPlain(NULL, StrLength(Buf));
+	LinePos = NULL;
+	do
+	{
+		StrBufSipLine(LineBuf, Buf, &LinePos);
+		if (StrLength(LineBuf) != 0) {
+			Node = NewNode(LineBuf);
+			if (Node != NULL) {
+				Put(Hash, SKEY(Node->NodeName), Node, DeleteNodeConf);
+			}
+		}
+	} while (LinePos != StrBufNOTNULL);
+	FreeStrBuf(&Buf);
+	FreeStrBuf(&LineBuf);
+	return Hash;
 }
 
+void DeleteNetMap(void *vNetMap)
+{
+	NetMap *TheNetMap = (NetMap*) vNetMap;
+	FreeStrBuf(&TheNetMap->NodeName);
+	FreeStrBuf(&TheNetMap->NextHop);
+	free(TheNetMap);
+}
 
-/* 
- * Read the network map from its configuration file into memory.
- */
-NetMap *read_network_map(void) {
-	char *serialized_map = NULL;
-	int i;
-	char buf[SIZ];
-	NetMap *nmptr, *the_netmap;
+NetMap *NewNetMap(StrBuf *SerializedNetMap)
+{
+	const char *Pos = NULL;
+	NetMap *NM;
+
+	/* we need at least 3 pipes and some other text so its invalid. */
+	if (StrLength(SerializedNetMap) < 6)
+		return NULL;
+	NM = (NetMap *) malloc(sizeof(NetMap));
+
+	NM->NodeName=NewStrBuf();
+	StrBufExtract_NextToken(NM->NodeName, SerializedNetMap, &Pos, '|');
+
+	NM->lastcontact = StrBufExtractNext_long(SerializedNetMap, &Pos, '|');
+
+	NM->NextHop=NewStrBuf();
+	StrBufExtract_NextToken(NM->NextHop, SerializedNetMap, &Pos, '|');
 
-	the_netmap = NULL;
-	serialized_map = CtdlGetSysConfig(IGNETMAP);
-	if (serialized_map == NULL) return NULL;	/* if null, no entries */
-
-	/* Use the string tokenizer to grab one line at a time */
-	for (i=0; i<num_tokens(serialized_map, '\n'); ++i) {
-		extract_token(buf, serialized_map, i, '\n', sizeof buf);
-		nmptr = (NetMap *) malloc(sizeof(NetMap));
-		extract_token(nmptr->nodename, buf, 0, '|', sizeof nmptr->nodename);
-		nmptr->lastcontact = extract_long(buf, 1);
-		extract_token(nmptr->nexthop, buf, 2, '|', sizeof nmptr->nexthop);
-		nmptr->next = the_netmap;
-		the_netmap = nmptr;
+	return NM;
+}
+
+HashList* read_network_map(void)
+{
+	const char *LinePos;
+	char       *Cfg;
+	StrBuf     *Buf;
+	StrBuf     *LineBuf;
+	HashList   *Hash;
+	NetMap     *TheNetMap;
+
+	Cfg =  CtdlGetSysConfig(IGNETMAP);
+	if ((Cfg == NULL) || IsEmptyStr(Cfg)) {
+		if (Cfg != NULL)
+			free(Cfg);
+		return NULL;
+	}
+
+	Hash = NewHash(1, NULL);
+	Buf = NewStrBufPlain(Cfg, -1);
+	free(Cfg);
+	LineBuf = NewStrBufPlain(NULL, StrLength(Buf));
+	LinePos = NULL;
+	while (StrBufSipLine(Buf, LineBuf, &LinePos))
+	{
+		TheNetMap = NewNetMap(LineBuf);
+		if (TheNetMap != NULL) { /* TODO: is the NodeName Uniq? */
+			Put(Hash, SKEY(TheNetMap->NodeName), TheNetMap, DeleteNetMap);
+		}
 	}
+	FreeStrBuf(&Buf);
+	FreeStrBuf(&LineBuf);
+	return Hash;
+}
+
+StrBuf *SerializeNetworkMap(HashList *Map)
+{
+	void *vMap;
+	const char *key;
+	long len;
+	StrBuf *Ret = NewStrBuf();
+	HashPos *Pos = GetNewHashPos(Map, 0);
 
-	free(serialized_map);
-	return the_netmap;
+	while (GetNextHashPos(Map, Pos, &len, &key, &vMap))
+	{
+		NetMap *pMap = (NetMap*) vMap;
+		StrBufAppendBuf(Ret, pMap->NodeName, 0);
+		StrBufAppendBufPlain(Ret, HKEY("|"), 0);
+
+		StrBufAppendPrintf(Ret, "%ld", pMap->lastcontact, 0);
+		StrBufAppendBufPlain(Ret, HKEY("|"), 0);
+
+		StrBufAppendBuf(Ret, pMap->NextHop, 0);
+		StrBufAppendBufPlain(Ret, HKEY("\n"), 0);
+	}
+	DeleteHashPos(&Pos);
+	return Ret;
 }
 
 
 /*
- * Write the network map from memory back to the configuration file.
+ * Learn topology from path fields
  */
-void write_network_map(NetMap *the_netmap, int netmap_changed) {
-	char *serialized_map = NULL;
+void network_learn_topology(char *node, char *path, HashList *the_netmap, int *netmap_changed)
+{
+	NetMap *pNM = NULL;
+	void *vptr;
+	char nexthop[256];
 	NetMap *nmptr;
 
-
-	if (netmap_changed) {
-		serialized_map = strdup("");
-	
-		if (the_netmap != NULL) {
-			for (nmptr = the_netmap; nmptr != NULL; nmptr = nmptr->next) {
-				serialized_map = realloc(serialized_map,
-							(strlen(serialized_map)+SIZ) );
-				if (!IsEmptyStr(nmptr->nodename)) {
-					snprintf(&serialized_map[strlen(serialized_map)],
-						SIZ,
-						"%s|%ld|%s\n",
-						nmptr->nodename,
-						(long)nmptr->lastcontact,
-						nmptr->nexthop);
-				}
-			}
+	if (GetHash(the_netmap, node, strlen(node), &vptr) && 
+	    (vptr != NULL))/* TODO: is the NodeName Uniq? */
+	{
+		pNM = (NetMap*)vptr;
+		extract_token(nexthop, path, 0, '!', sizeof nexthop);
+		if (!strcmp(nexthop, ChrPtr(pNM->NextHop))) {
+			pNM->lastcontact = time(NULL);
+			(*netmap_changed) ++;
+			return;
 		}
-
-		CtdlPutSysConfig(IGNETMAP, serialized_map);
-		free(serialized_map);
 	}
 
-	/* Now free the list */
-	while (the_netmap != NULL) {
-		nmptr = the_netmap->next;
-		free(the_netmap);
-		the_netmap = nmptr;
-	}
-	netmap_changed = 0;
+	/* If we got here then it's not in the map, so add it. */
+	nmptr = (NetMap *) malloc(sizeof (NetMap));
+	nmptr->NodeName = NewStrBufPlain(node, -1);
+	nmptr->lastcontact = time(NULL);
+	nmptr->NextHop = NewStrBuf ();
+	StrBufExtract_tokenFromStr(nmptr->NextHop, path, strlen(path), 0, '!');
+	/* TODO: is the NodeName Uniq? */
+	Put(the_netmap, SKEY(nmptr->NodeName), nmptr, DeleteNetMap);
+	(*netmap_changed) ++;
 }
 
 
-
-/* 
+/*
  * Check the network map and determine whether the supplied node name is
  * valid.  If it is not a neighbor node, supply the name of a neighbor node
  * which is the next hop.  If it *is* a neighbor node, we also fill in the
  * shared secret.
  */
-int is_valid_node(char *nexthop, 
-		  char *secret, 
-		  char *node, 
-		  char *working_ignetcfg, 
-		  NetMap *the_netmap)
+int is_valid_node(const StrBuf **nexthop,
+		  const StrBuf **secret,
+		  StrBuf *node,
+		  HashList *IgnetCfg,
+		  HashList *the_netmap)
 {
-	int i;
-	char linebuf[SIZ];
-	char buf[SIZ];
-	int retval;
-	NetMap *nmptr;
+	void *vNetMap;
+	void *vNodeConf;
+	NodeConf *TheNode;
+	NetMap *TheNetMap;
 
-	if (node == NULL) {
+	if (StrLength(node) == 0) {
 		return(-1);
 	}
 
 	/*
 	 * First try the neighbor nodes
 	 */
-	if ((working_ignetcfg == NULL) || (*working_ignetcfg == '\0')) {
-		syslog(LOG_ERR, "working_ignetcfg is empty!\n");
+	if (GetCount(IgnetCfg) == 0) {
+		syslog(LOG_INFO, "IgnetCfg is empty!\n");
 		if (nexthop != NULL) {
-			strcpy(nexthop, "");
+			*nexthop = NULL;
 		}
 		return(-1);
 	}
 
-	retval = (-1);
-	if (nexthop != NULL) {
-		strcpy(nexthop, "");
-	}
-
-	/* Use the string tokenizer to grab one line at a time */
-	for (i=0; i<num_tokens(working_ignetcfg, '\n'); ++i) {
-		extract_token(linebuf, working_ignetcfg, i, '\n', sizeof linebuf);
-		extract_token(buf, linebuf, 0, '|', sizeof buf);
-		if (!strcasecmp(buf, node)) {
-			if (nexthop != NULL) {
-				strcpy(nexthop, "");
-			}
-			if (secret != NULL) {
-				extract_token(secret, linebuf, 1, '|', 256);
-			}
-			retval = 0;
-		}
-	}
-
-	if (retval == 0) {
-		return(retval);		/* yup, it's a direct neighbor */
+	/* try to find a neigbour with the name 'node' */
+	if (GetHash(IgnetCfg, SKEY(node), &vNodeConf) && 
+	    (vNodeConf != NULL))
+	{
+		TheNode = (NodeConf*)vNodeConf;
+		if (secret != NULL)
+			*secret = TheNode->Secret;
+		return 0;		/* yup, it's a direct neighbor */
 	}
 
-	/*	
+	/*
 	 * If we get to this point we have to see if we know the next hop
-	 */
-	if (the_netmap != NULL) {
-		for (nmptr = the_netmap; nmptr != NULL; nmptr = nmptr->next) {
-			if (!strcasecmp(nmptr->nodename, node)) {
-				if (nexthop != NULL) {
-					strcpy(nexthop, nmptr->nexthop);
-				}
-				return(0);
-			}
-		}
+	 *//* TODO: is the NodeName Uniq? */
+	if ((GetCount(the_netmap) > 0) &&
+	    (GetHash(the_netmap, SKEY(node), &vNetMap)))
+	{
+		TheNetMap = (NetMap*)vNetMap;
+		if (nexthop != NULL)
+			*nexthop = TheNetMap->NextHop;
+		return(0);
 	}
 
 	/*
 	 * If we get to this point, the supplied node name is bogus.
 	 */
-	syslog(LOG_ERR, "Invalid node name <%s>\n", node);
+	syslog(LOG_ERR, "Invalid node name <%s>\n", ChrPtr(node));
 	return(-1);
 }
 
 
-
-void cmd_gnet(char *argbuf) {
+void cmd_gnet(char *argbuf)
+{
 	char filename[PATH_MAX];
 	char buf[SIZ];
 	FILE *fp;
@@ -363,24 +466,24 @@
  */
 void cmd_netp(char *cmdbuf)
 {
-	char *working_ignetcfg;
-	char node[256];
+	struct CitContext *CCC = CC;
+	HashList *working_ignetcfg;
+	char *node;
+	StrBuf *NodeStr;
 	long nodelen;
-	char pass[256];
 	int v;
 
-	char secret[256];
-	char nexthop[256];
-	char err_buf[SIZ];
+	const StrBuf *secret = NULL;
+	const StrBuf *nexthop = NULL;
+	char err_buf[SIZ] = "";
 
 	/* Authenticate */
-	nodelen = extract_token(node, cmdbuf, 0, '|', sizeof node);
-	extract_token(pass, cmdbuf, 1, '|', sizeof pass);
-
+	node = CCC->curr_user;
+	nodelen = extract_token(CCC->curr_user, cmdbuf, 0, '|', sizeof CCC->curr_user);
+	NodeStr = NewStrBufPlain(node, nodelen);
 	/* load the IGnet Configuration to check node validity */
-	working_ignetcfg = load_working_ignetcfg();
-	v = is_valid_node(nexthop, secret, node, working_ignetcfg, NULL); //// TODO do we need the netmap?
-
+	working_ignetcfg = load_ignetcfg();
+	v = is_valid_node(&nexthop, &secret, NodeStr, working_ignetcfg, NULL);
 	if (v != 0) {
 		snprintf(err_buf, sizeof err_buf,
 			"An unknown Citadel server called \"%s\" attempted to connect from %s [%s].\n",
@@ -389,11 +492,13 @@
 		syslog(LOG_WARNING, "%s", err_buf);
 		cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
 		CtdlAideMessage(err_buf, "IGNet Networking.");
-		free(working_ignetcfg);
+		DeleteHash(&working_ignetcfg);
+		FreeStrBuf(&NodeStr);
 		return;
 	}
 
-	if (strcasecmp(pass, secret)) {
+	extract_token(CCC->user.password, cmdbuf, 1, '|', sizeof CCC->user.password);
+	if (strcasecmp(CCC->user.password, ChrPtr(secret))) {
 		snprintf(err_buf, sizeof err_buf,
 			"A Citadel server at %s [%s] failed to authenticate as network node \"%s\".\n",
 			CC->cs_host, CC->cs_addr, node
@@ -401,24 +506,26 @@
 		syslog(LOG_WARNING, "%s", err_buf);
 		cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
 		CtdlAideMessage(err_buf, "IGNet Networking.");
-		free(working_ignetcfg);
+		DeleteHash(&working_ignetcfg);
+		FreeStrBuf(&NodeStr);
 		return;
 	}
 
 	if (network_talking_to(node, nodelen, NTT_CHECK)) {
 		syslog(LOG_WARNING, "Duplicate session for network node <%s>", node);
 		cprintf("%d Already talking to %s right now\n", ERROR + RESOURCE_BUSY, node);
-		free(working_ignetcfg);
+		DeleteHash(&working_ignetcfg);
+		FreeStrBuf(&NodeStr);
 		return;
 	}
-
-	safestrncpy(CC->net_node, node, sizeof CC->net_node);
-	network_talking_to(node, nodelen, NTT_ADD);
+	nodelen = safestrncpy(CC->net_node, node, sizeof CC->net_node);
+	network_talking_to(CC->net_node, nodelen, NTT_ADD);
 	syslog(LOG_NOTICE, "Network node <%s> logged in from %s [%s]\n",
 		CC->net_node, CC->cs_host, CC->cs_addr
 	);
 	cprintf("%d authenticated as network node '%s'\n", CIT_OK, CC->net_node);
-	free(working_ignetcfg);
+	DeleteHash(&working_ignetcfg);
+	FreeStrBuf(&NodeStr);
 }
 
 int netconfig_check_roomaccess(
diff -Nru citadel-8.11/modules/network/serv_netmail.c citadel-8.12/modules/network/serv_netmail.c
--- citadel-8.11/modules/network/serv_netmail.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/network/serv_netmail.c	2012-06-26 17:56:25.000000000 +0200
@@ -2,7 +2,7 @@
  * This module handles shared rooms, inter-Citadel mail, and outbound
  * mailing list processing.
  *
- * Copyright (c) 2000-2011 by the citadel.org team
+ * Copyright (c) 2000-2012 by the citadel.org team
  *
  *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -97,6 +97,7 @@
  * Deliver digest messages
  */
 void network_deliver_digest(SpoolControl *sc) {
+	struct CitContext *CCC = CC;
 	char buf[SIZ];
 	int i;
 	struct CtdlMessage *msg = NULL;
@@ -167,9 +168,9 @@
 	recps = malloc(recps_len);
 
 	if (recps == NULL) {
-		syslog(LOG_EMERG,
-		       "Cannot allocate %ld bytes for recps...\n",
-		       (long)recps_len);
+		QN_syslog(LOG_EMERG,
+			  "Cannot allocate %ld bytes for recps...\n",
+			  (long)recps_len);
 		abort();
 	}
 
@@ -203,7 +204,9 @@
 /*
  * Deliver list messages to everyone on the list ... efficiently
  */
-void network_deliver_list(struct CtdlMessage *msg, SpoolControl *sc, const char *RoomName) {
+void network_deliver_list(struct CtdlMessage *msg, SpoolControl *sc, const char *RoomName)
+{
+	struct CitContext *CCC = CC;
 	char *recps = NULL;
 	size_t recps_len = SIZ;
 	struct recptypes *valid;
@@ -225,9 +228,9 @@
 	recps = malloc(recps_len);
 
 	if (recps == NULL) {
-		syslog(LOG_EMERG,
-		       "Cannot allocate %ld bytes for recps...\n",
-		       (long)recps_len);
+		QN_syslog(LOG_EMERG,
+			  "Cannot allocate %ld bytes for recps...\n",
+			  (long)recps_len);
 		abort();
 	}
 
@@ -265,6 +268,8 @@
 void network_spool_msg(long msgnum,
 		       void *userdata)
 {
+	struct CitContext *CCC = CC;
+	StrBuf *Buf = NULL;
 	SpoolControl *sc;
 	int i;
 	char *newpath = NULL;
@@ -470,9 +475,11 @@
 						config.c_nodename)) {
 					ok_to_participate = 1;
 				}
+
+				Buf = NewStrBufPlain(msg->cm_fields['N'], -1);
 				if (is_valid_node(NULL,
 						  NULL,
-						  msg->cm_fields['N'],
+						  Buf,
 						  sc->working_ignetcfg,
 						  sc->the_netmap) == 0)
 				{
@@ -560,42 +567,46 @@
 		    mptr = mptr->next) {
 
 			send = 1;
-
+			if (Buf == NULL)
+				Buf = NewStrBufPlain(mptr->remote_nodename, -1);
+			else
+				StrBufPlain(Buf, mptr->remote_nodename, -1);
 			/* Check for valid node name */
 			if (is_valid_node(NULL,
 					  NULL,
-					  mptr->remote_nodename,
+					  Buf,
 					  sc->working_ignetcfg,
 					  sc->the_netmap) != 0)
 			{
-				syslog(LOG_ERR,
-				       "Invalid node <%s>\n",
-				       mptr->remote_nodename);
+				QN_syslog(LOG_ERR,
+					  "Invalid node <%s>\n",
+					  mptr->remote_nodename);
 
 				send = 0;
 			}
 
 			/* Check for split horizon */
-			syslog(LOG_DEBUG, "Path is %s\n", msg->cm_fields['P']);
+			QN_syslog(LOG_DEBUG, "Path is %s\n", msg->cm_fields['P']);
 			bang = num_tokens(msg->cm_fields['P'], '!');
-			if (bang > 1) for (i=0; i<(bang-1); ++i) {
-				extract_token(buf,
-					      msg->cm_fields['P'],
-					      i, '!',
-					      sizeof buf);
-
-				syslog(LOG_DEBUG, "Compare <%s> to <%s>\n",
-					buf, mptr->remote_nodename) ;
-				if (!strcasecmp(buf, mptr->remote_nodename)) {
-					send = 0;
-					syslog(LOG_DEBUG, "Not sending to %s\n",
-						mptr->remote_nodename);
-				}
-				else {
-					syslog(LOG_DEBUG,
-					       "Sending to %s\n",
-					       mptr->remote_nodename);
+			if (bang > 1) {
+				for (i=0; i<(bang-1); ++i) {
+					extract_token(buf,
+						      msg->cm_fields['P'],
+						      i, '!',
+						      sizeof buf);
+					
+					QN_syslog(LOG_DEBUG, "Compare <%s> to <%s>\n",
+						  buf, mptr->remote_nodename) ;
+					if (!strcasecmp(buf, mptr->remote_nodename)) {
+						send = 0;
+						break;
+					}
 				}
+
+				QN_syslog(LOG_INFO,
+					  "%sSending to %s\n",
+					  (send)?"":"Not ",
+					  mptr->remote_nodename);
 			}
 
 			/* Send the message */
@@ -632,9 +643,9 @@
 						 rand()
 					);
 
-					syslog(LOG_DEBUG,
-					       "Appending to %s\n",
-					       filename);
+					QN_syslog(LOG_DEBUG,
+						  "Appending to %s\n",
+						  filename);
 
 					fp = fopen(filename, "ab");
 					if (fp != NULL) {
@@ -643,10 +654,10 @@
 						fclose(fp);
 					}
 					else {
-						syslog(LOG_ERR,
-						       "%s: %s\n",
-						       filename,
-						       strerror(errno));
+						QN_syslog(LOG_ERR,
+							  "%s: %s\n",
+							  filename,
+							  strerror(errno));
 					}
 
 					/* free the serialized version */
@@ -665,5 +676,5 @@
 	if (delete_after_send) {
 		CtdlDeleteMessages(CC->room.QRname, &msgnum, 1, "");
 	}
-
+	FreeStrBuf(&Buf);
 }
diff -Nru citadel-8.11/modules/network/serv_netspool.c citadel-8.12/modules/network/serv_netspool.c
--- citadel-8.11/modules/network/serv_netspool.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/network/serv_netspool.c	2012-06-26 17:56:25.000000000 +0200
@@ -2,7 +2,7 @@
  * This module handles shared rooms, inter-Citadel mail, and outbound
  * mailing list processing.
  *
- * Copyright (c) 2000-2011 by the citadel.org team
+ * Copyright (c) 2000-2012 by the citadel.org team
  *
  *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -92,35 +92,6 @@
 #include "netmail.h"
 #include "ctdl_module.h"
 
-/*
- * Learn topology from path fields
- */
-void network_learn_topology(char *node, char *path, NetMap **the_netmap, int *netmap_changed) {
-	char nexthop[256];
-	NetMap *nmptr;
-
-	*nexthop = '\0';
-
-	if (num_tokens(path, '!') < 3) return;
-	for (nmptr = *the_netmap; nmptr != NULL; nmptr = nmptr->next) {
-		if (!strcasecmp(nmptr->nodename, node)) {
-			extract_token(nmptr->nexthop, path, 0, '!', sizeof nmptr->nexthop);
-			nmptr->lastcontact = time(NULL);
-			(*netmap_changed) ++;
-			return;
-		}
-	}
-
-	/* If we got here then it's not in the map, so add it. */
-	nmptr = (NetMap *) malloc(sizeof (NetMap));
-	strcpy(nmptr->nodename, node);
-	nmptr->lastcontact = time(NULL);
-	extract_token(nmptr->nexthop, path, 0, '!', sizeof nmptr->nexthop);
-	nmptr->next = *the_netmap;
-	the_netmap = &nmptr;
-	(*netmap_changed) ++;
-}
-
 
 	
 
@@ -381,8 +352,8 @@
  * Batch up and send all outbound traffic from the current room
  */
 void network_spoolout_room(RoomProcList *room_to_spool, 		       
-			   char *working_ignetcfg,
-			   NetMap *the_netmap)
+			   HashList *working_ignetcfg,
+			   HashList *the_netmap)
 {
 	char buf[SIZ];
 	char filename[PATH_MAX];
@@ -451,8 +422,10 @@
  * Process a buffer containing a single message from a single file
  * from the inbound queue 
  */
-void network_process_buffer(char *buffer, long size, char *working_ignetcfg, NetMap **the_netmap, int *netmap_changed)
+void network_process_buffer(char *buffer, long size, HashList *working_ignetcfg, HashList *the_netmap, int *netmap_changed)
 {
+	struct CitContext *CCC = CC;
+	StrBuf *Buf = NULL;
 	struct CtdlMessage *msg = NULL;
 	long pos;
 	int field;
@@ -462,18 +435,18 @@
 	char *oldpath = NULL;
 	char filename[PATH_MAX];
 	FILE *fp;
-	char nexthop[SIZ];
+	const StrBuf *nexthop = NULL;
 	unsigned char firstbyte;
 	unsigned char lastbyte;
 
-	syslog(LOG_DEBUG, "network_process_buffer() processing %ld bytes\n", size);
+	QN_syslog(LOG_DEBUG, "network_process_buffer() processing %ld bytes\n", size);
 
 	/* Validate just a little bit.  First byte should be FF and * last byte should be 00. */
 	firstbyte = buffer[0];
 	lastbyte = buffer[size-1];
 	if ( (firstbyte != 255) || (lastbyte != 0) ) {
-		syslog(LOG_ERR, "Corrupt message ignored.  Length=%ld, firstbyte = %d, lastbyte = %d\n",
-			size, firstbyte, lastbyte);
+		QN_syslog(LOG_ERR, "Corrupt message ignored.  Length=%ld, firstbyte = %d, lastbyte = %d\n",
+			  size, firstbyte, lastbyte);
 		return;
 	}
 
@@ -498,12 +471,12 @@
 		if (strcasecmp(msg->cm_fields['D'], config.c_nodename)) {
 
 			/* route the message */
-			strcpy(nexthop, "");
-			if (is_valid_node(nexthop, 
+			Buf = NewStrBufPlain(msg->cm_fields['D'], -1);
+			if (is_valid_node(&nexthop, 
 					  NULL, 
-					  msg->cm_fields['D'], 
+					  Buf, 
 					  working_ignetcfg, 
-					  *the_netmap) == 0) 
+					  the_netmap) == 0) 
 			{
 				/* prepend our node to the path */
 				if (msg->cm_fields['P'] != NULL) {
@@ -523,32 +496,34 @@
 				serialize_message(&sermsg, msg);
 
 				/* now send it */
-				if (IsEmptyStr(nexthop)) {
-					strcpy(nexthop, msg->cm_fields['D']);
+				if (StrLength(nexthop) == 0) {
+					nexthop = Buf;
 				}
-				snprintf(filename, 
-					sizeof filename,
-					"%s/%s@%lx%x",
-					ctdl_netout_dir,
-					nexthop,
-					time(NULL),
-					rand()
+				snprintf(filename,
+					 sizeof filename,
+					 "%s/%s@%lx%x",
+					 ctdl_netout_dir,
+					 ChrPtr(nexthop),
+					 time(NULL),
+					 rand()
 				);
-				syslog(LOG_DEBUG, "Appending to %s\n", filename);
+				QN_syslog(LOG_DEBUG, "Appending to %s\n", filename);
 				fp = fopen(filename, "ab");
 				if (fp != NULL) {
 					fwrite(sermsg.ser, sermsg.len, 1, fp);
 					fclose(fp);
 				}
 				else {
-					syslog(LOG_ERR, "%s: %s\n", filename, strerror(errno));
+					QN_syslog(LOG_ERR, "%s: %s\n", filename, strerror(errno));
 				}
 				free(sermsg.ser);
 				CtdlFreeMessage(msg);
+				FreeStrBuf(&Buf);
 				return;
 			}
 			
 			else {	/* invalid destination node name */
+				FreeStrBuf(&Buf);
 
 				network_bounce(msg,
 "A message you sent could not be delivered due to an invalid destination node"
@@ -595,7 +570,7 @@
 				"Please check the address and try sending the message again.\n");
 			msg = NULL;
 			free_recipients(recp);
-			syslog(LOG_DEBUG, "Bouncing message due to invalid recipient address.\n");
+			QNM_syslog(LOG_DEBUG, "Bouncing message due to invalid recipient address.\n");
 			return;
 		}
 		strcpy(target_room, "");	/* no target room if mail */
@@ -634,8 +609,8 @@
 void network_process_message(FILE *fp, 
 			     long msgstart, 
 			     long msgend,
-			     char *working_ignetcfg,
-			     NetMap **the_netmap, 
+			     HashList *working_ignetcfg,
+			     HashList *the_netmap, 
 			     int *netmap_changed)
 {
 	long hold_pos;
@@ -665,10 +640,11 @@
  * Process a single file from the inbound queue 
  */
 void network_process_file(char *filename,
-			  char *working_ignetcfg,
-			  NetMap **the_netmap, 
+			  HashList *working_ignetcfg,
+			  HashList *the_netmap, 
 			  int *netmap_changed)
 {
+	struct CitContext *CCC = CC;
 	FILE *fp;
 	long msgstart = (-1L);
 	long msgend = (-1L);
@@ -678,12 +654,12 @@
 
 	fp = fopen(filename, "rb");
 	if (fp == NULL) {
-		syslog(LOG_CRIT, "Error opening %s: %s\n", filename, strerror(errno));
+		QN_syslog(LOG_CRIT, "Error opening %s: %s\n", filename, strerror(errno));
 		return;
 	}
 
 	fseek(fp, 0L, SEEK_END);
-	syslog(LOG_INFO, "network: processing %ld bytes from %s\n", ftell(fp), filename);
+	QN_syslog(LOG_INFO, "network: processing %ld bytes from %s\n", ftell(fp), filename);
 	rewind(fp);
 
 	/* Look for messages in the data stream and break them out */
@@ -723,8 +699,9 @@
 /*
  * Process anything in the inbound queue
  */
-void network_do_spoolin(char *working_ignetcfg, NetMap **the_netmap, int *netmap_changed)
+void network_do_spoolin(HashList *working_ignetcfg, HashList *the_netmap, int *netmap_changed)
 {
+	struct CitContext *CCC = CC;
 	DIR *dp;
 	struct dirent *d;
 	struct stat statbuf;
@@ -737,11 +714,11 @@
 	 */
 	if (stat(ctdl_netin_dir, &statbuf)) return;
 	if (statbuf.st_mtime == last_spoolin_mtime) {
-		syslog(LOG_DEBUG, "network: nothing in inbound queue\n");
+		QNM_syslog(LOG_DEBUG, "network: nothing in inbound queue\n");
 		return;
 	}
 	last_spoolin_mtime = statbuf.st_mtime;
-	syslog(LOG_DEBUG, "network: processing inbound queue\n");
+	QNM_syslog(LOG_DEBUG, "network: processing inbound queue\n");
 
 	/*
 	 * Ok, there's something interesting in there, so scan it.
@@ -771,92 +748,234 @@
  * Step 1: consolidate files in the outbound queue into one file per neighbor node
  * Step 2: delete any files in the outbound queue that were for neighbors who no longer exist.
  */
-void network_consolidate_spoolout(char *working_ignetcfg, NetMap *the_netmap)
+void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netmap)
 {
+	struct CitContext *CCC = CC;
+	IOBuffer IOB;
+	FDIOBuffer FDIO;
+        int d_namelen;
 	DIR *dp;
 	struct dirent *d;
+	struct dirent *filedir_entry;
+	const char *pch;
+	char spooloutfilename[PATH_MAX];
 	char filename[PATH_MAX];
-	char cmd[PATH_MAX];
-	char nexthop[256];
-	long nexthoplen;
+	const StrBuf *nexthop;
+	StrBuf *NextHop;
 	int i;
-	char *ptr;
+	int nFailed = 0;
 
 	/* Step 1: consolidate files in the outbound queue into one file per neighbor node */
+	d = (struct dirent *)malloc(offsetof(struct dirent, d_name) + PATH_MAX + 1);
+	if (d == NULL) 	return;
+
 	dp = opendir(ctdl_netout_dir);
-	if (dp == NULL) return;
-	while (d = readdir(dp), d != NULL) {
-		if (
-			(strcmp(d->d_name, "."))
-			&& (strcmp(d->d_name, ".."))
-			&& (strchr(d->d_name, '@') != NULL)
-		) {
-			nexthoplen = safestrncpy(nexthop, d->d_name, sizeof nexthop);
-			ptr = strchr(nexthop, '@');
-			if (ptr) {
-				*ptr = 0;
-				nexthoplen = ptr - nexthop;
-			}				
-	
-			snprintf(filename, 
-				sizeof filename,
-				"%s/%s",
-				ctdl_netout_dir,
-				d->d_name
-			);
-	
-			syslog(LOG_DEBUG, "Consolidate %s to %s\n", filename, nexthop);
-			if (network_talking_to(nexthop, nexthoplen, NTT_CHECK)) {
-				syslog(LOG_DEBUG,
-					"Currently online with %s - skipping for now\n",
-					nexthop
+	if (dp == NULL) {
+		free(d);
+		return;
+	}
+
+	NextHop = NewStrBuf();
+	memset(&IOB, 0, sizeof(IOBuffer));
+	memset(&FDIO, 0, sizeof(FDIOBuffer));
+	FDIO.IOB = &IOB;
+
+	while ((readdir_r(dp, d, &filedir_entry) == 0) &&
+	       (filedir_entry != NULL))
+	{
+#ifdef _DIRENT_HAVE_D_NAMELEN
+		d_namelen = filedir_entry->d_namelen;
+#else
+
+#ifndef DT_UNKNOWN
+#define DT_UNKNOWN     0
+#define DT_DIR         4
+#define DT_REG         8
+#define DT_LNK         10
+
+#define IFTODT(mode)   (((mode) & 0170000) >> 12)
+#define DTTOIF(dirtype)        ((dirtype) << 12)
+#endif
+		d_namelen = strlen(filedir_entry->d_name);
+#endif
+		if ((d_namelen > 1) && filedir_entry->d_name[d_namelen - 1] == '~')
+			continue; /* Ignore backup files... */
+
+		if ((d_namelen == 1) && 
+		    (filedir_entry->d_name[0] == '.'))
+			continue;
+
+		if ((d_namelen == 2) && 
+		    (filedir_entry->d_name[0] == '.') &&
+		    (filedir_entry->d_name[1] == '.'))
+			continue;
+
+		pch = strchr(filedir_entry->d_name, '@');
+		if (pch == NULL)
+			continue;
+
+		snprintf(filename, 
+			 sizeof filename,
+			 "%s/%s",
+			 ctdl_netout_dir,
+			 filedir_entry->d_name);
+
+		StrBufPlain(NextHop,
+			    filedir_entry->d_name,
+			    pch - filedir_entry->d_name);
+
+		snprintf(spooloutfilename,
+			 sizeof spooloutfilename,
+			 "%s/%s",
+			 ctdl_netout_dir,
+			 ChrPtr(NextHop));
+
+		QN_syslog(LOG_DEBUG, "Consolidate %s to %s\n", filename, ChrPtr(NextHop));
+		if (network_talking_to(SKEY(NextHop), NTT_CHECK)) {
+			nFailed++;
+			QN_syslog(LOG_DEBUG,
+				  "Currently online with %s - skipping for now\n",
+				  ChrPtr(NextHop)
 				);
+		}
+		else {
+			size_t dsize;
+			size_t fsize;
+			int fd;
+			const char *err = NULL;
+			network_talking_to(SKEY(NextHop), NTT_ADD);
+
+			IOB.fd = open(filename, O_RDONLY);
+			if (IOB.fd == -1) {
+				nFailed++;
+				QN_syslog(LOG_ERR,
+					  "failed to open %s for reading due to %s; skipping.\n",
+					  filename, strerror(errno)
+					);
+				network_talking_to(SKEY(NextHop), NTT_REMOVE);
+				continue;				
+			}
+			
+			fd = open(spooloutfilename,
+				  O_EXCL|O_CREAT|O_NONBLOCK|O_WRONLY, 
+				  S_IRUSR|S_IWUSR);
+			if (fd == -1)
+			{
+				fd = open(spooloutfilename,
+					  O_EXCL|O_NONBLOCK|O_WRONLY, 
+					  S_IRUSR | S_IWUSR);
+			}
+			if (fd == -1) {
+				nFailed++;
+				QN_syslog(LOG_ERR,
+					  "failed to open %s for reading due to %s; skipping.\n",
+					  spooloutfilename, strerror(errno)
+					);
+				close(IOB.fd);
+				network_talking_to(SKEY(NextHop), NTT_REMOVE);
+				continue;
+			}
+			dsize = lseek(fd, 0, SEEK_END);
+			fsize = lseek(IOB.fd, 0, SEEK_END);
+			
+			FDIOBufferInit(&FDIO, &IOB, fd, fsize + dsize);
+			FDIO.ChunkSendRemain = fsize;
+			FDIO.TotalSentAlready = dsize;
+			err = NULL;
+			do {} while ((FileMoveChunked(&FDIO, &err) > 0) && (err == NULL));
+			if (err == NULL) {
+				unlink(filename);
 			}
 			else {
-				network_talking_to(nexthop, nexthoplen, NTT_ADD);
-				snprintf(cmd, sizeof cmd, "/bin/cat %s >>%s/%s && /bin/rm -f %s",
-					filename,
-					ctdl_netout_dir, nexthop,
-					filename
-				);
-				system(cmd);
-				network_talking_to(nexthop, nexthoplen, NTT_REMOVE);
+				nFailed++;
+				QN_syslog(LOG_ERR,
+					  "failed to append to %s [%s]; rolling back..\n",
+					  spooloutfilename, strerror(errno)
+					);
+				/* whoops partial append?? truncate spooloutfilename again! */
+				ftruncate(fd, dsize);
 			}
+			FDIOBufferDelete(&FDIO);
+			close(IOB.fd);
+			close(fd);
+			network_talking_to(SKEY(NextHop), NTT_REMOVE);
 		}
 	}
 	closedir(dp);
 
-	/* Step 2: delete any files in the outbound queue that were for neighbors who no longer exist */
+	if (nFailed > 0) {
+		FreeStrBuf(&NextHop);
+		QN_syslog(LOG_INFO,
+			  "skipping Spoolcleanup because of %d files unprocessed.\n",
+			  nFailed
+			);
 
+		return;
+	}
+
+	/* Step 2: delete any files in the outbound queue that were for neighbors who no longer exist */
 	dp = opendir(ctdl_netout_dir);
-	if (dp == NULL) return;
+	if (dp == NULL) {
+		FreeStrBuf(&NextHop);
+		free(d);
+		return;
+	}
 
-	while (d = readdir(dp), d != NULL) {
-		if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
+	while ((readdir_r(dp, d, &filedir_entry) == 0) &&
+	       (filedir_entry != NULL))
+	{
+#ifdef _DIRENT_HAVE_D_NAMELEN
+		d_namelen = filedir_entry->d_namelen;
+		d_type = filedir_entry->d_type;
+#else
+
+#ifndef DT_UNKNOWN
+#define DT_UNKNOWN     0
+#define DT_DIR         4
+#define DT_REG         8
+#define DT_LNK         10
+
+#define IFTODT(mode)   (((mode) & 0170000) >> 12)
+#define DTTOIF(dirtype)        ((dirtype) << 12)
+#endif
+		d_namelen = strlen(filedir_entry->d_name);
+#endif
+		if ((d_namelen == 1) && 
+		    (filedir_entry->d_name[0] == '.'))
+			continue;
+
+		if ((d_namelen == 2) && 
+		    (filedir_entry->d_name[0] == '.') &&
+		    (filedir_entry->d_name[1] == '.'))
 			continue;
-		ptr = strchr(d->d_name, '@');
-		if (d != NULL)
+
+		pch = strchr(filedir_entry->d_name, '@');
+		if (pch == NULL) /* no @ in name? consolidated file. */
 			continue;
+
+		StrBufPlain(NextHop,
+			    filedir_entry->d_name,
+			    pch - filedir_entry->d_name);
+
 		snprintf(filename, 
 			sizeof filename,
 			"%s/%s",
 			ctdl_netout_dir,
-			d->d_name
+			filedir_entry->d_name
 		);
 
-		strcpy(nexthop, "");
-		i = is_valid_node(nexthop,
+		i = is_valid_node(&nexthop,
 				  NULL,
-				  d->d_name,
+				  NextHop,
 				  working_ignetcfg,
 				  the_netmap);
 	
-		if ( (i != 0) || !IsEmptyStr(nexthop) ) {
+		if ( (i != 0) || (StrLength(nexthop) > 0) ) {
 			unlink(filename);
 		}
 	}
-
-
+	FreeStrBuf(&NextHop);
+	free(d);
 	closedir(dp);
 }
 
diff -Nru citadel-8.11/modules/network/serv_network.c citadel-8.12/modules/network/serv_network.c
--- citadel-8.11/modules/network/serv_network.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/network/serv_network.c	2012-06-26 17:56:25.000000000 +0200
@@ -2,7 +2,7 @@
  * This module handles shared rooms, inter-Citadel mail, and outbound
  * mailing list processing.
  *
- * Copyright (c) 2000-2011 by the citadel.org team
+ * Copyright (c) 2000-2012 by the citadel.org team
  *
  *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -92,6 +92,9 @@
 #include "netmail.h"
 #include "ctdl_module.h"
 
+int NetQDebugEnabled = 0;
+struct CitContext networker_spool_CC;
+
 /* comes from lookup3.c from libcitadel... */
 extern uint32_t hashlittle( const void *key, size_t length, uint32_t initval);
 
@@ -147,8 +150,9 @@
  * message from being entered into the database multiple times if it happens
  * to arrive multiple times by accident.
  */
-int network_usetable(struct CtdlMessage *msg) {
-
+int network_usetable(struct CtdlMessage *msg)
+{
+	struct CitContext *CCC = CC;
 	char msgid[SIZ];
 	struct cdbdata *cdbut;
 	struct UseTable ut;
@@ -179,7 +183,7 @@
 	cdbut = cdb_fetch(CDB_USETABLE, msgid, strlen(msgid));
 	if (cdbut != NULL) {
 		cdb_free(cdbut);
-		syslog(LOG_DEBUG, "network_usetable() : we already have %s\n", msgid);
+		QN_syslog(LOG_DEBUG, "network_usetable() : we already have %s\n", msgid);
 		return(1);
 	}
 
@@ -204,7 +208,9 @@
  * ignoring anything we know about which messages have already undergone
  * network processing.  This can be used to bring a new node into sync.
  */
-int network_sync_to(char *target_node) {
+int network_sync_to(char *target_node, long len)
+{
+	struct CitContext *CCC = CC;
 	SpoolControl sc;
 	int num_spooled = 0;
 	int found_node = 0;
@@ -223,33 +229,41 @@
 		end_critical_section(S_NETCONFIGS);
 		return(-1);
 	}
-	while (fgets(buf, sizeof buf, fp) != NULL) {
+	while (fgets(buf, sizeof buf, fp) != NULL)
+	{
 		buf[strlen(buf)-1] = 0;
+
 		extract_token(sc_type, buf, 0, '|', sizeof sc_type);
+		if (strcasecmp(sc_type, "ignet_push_share"))
+			continue;
+
 		extract_token(sc_node, buf, 1, '|', sizeof sc_node);
+		if (strcasecmp(sc_node, target_node))
+			continue;
+
 		extract_token(sc_room, buf, 2, '|', sizeof sc_room);
-		if ( (!strcasecmp(sc_type, "ignet_push_share"))
-		   && (!strcasecmp(sc_node, target_node)) ) {
-			found_node = 1;
+		found_node = 1;
 			
-			/* Concise syntax because we don't need a full linked-list */
-			memset(&sc, 0, sizeof(SpoolControl));
-			sc.ignet_push_shares = (maplist *)
-				malloc(sizeof(maplist));
-			sc.ignet_push_shares->next = NULL;
-			safestrncpy(sc.ignet_push_shares->remote_nodename,
-				sc_node,
-				sizeof sc.ignet_push_shares->remote_nodename);
-			safestrncpy(sc.ignet_push_shares->remote_roomname,
-				sc_room,
-				sizeof sc.ignet_push_shares->remote_roomname);
-		}
+		/* Concise syntax because we don't need a full linked-list */
+		memset(&sc, 0, sizeof(SpoolControl));
+		sc.ignet_push_shares = (maplist *)
+			malloc(sizeof(maplist));
+		sc.ignet_push_shares->next = NULL;
+		safestrncpy(sc.ignet_push_shares->remote_nodename,
+			    sc_node,
+			    sizeof sc.ignet_push_shares->remote_nodename);
+		safestrncpy(sc.ignet_push_shares->remote_roomname,
+			    sc_room,
+			    sizeof sc.ignet_push_shares->remote_roomname);
 	}
 	fclose(fp);
 	end_critical_section(S_NETCONFIGS);
 
 	if (!found_node) return(-1);
 
+	sc.working_ignetcfg = load_ignetcfg();
+	sc.the_netmap = read_network_map();
+
 	/* Send ALL messages */
 	num_spooled = CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL,
 		network_spool_msg, &sc);
@@ -257,8 +271,11 @@
 	/* Concise cleanup because we know there's only one node in the sc */
 	free(sc.ignet_push_shares);
 
-	syslog(LOG_NOTICE, "Synchronized %d messages to <%s>\n",
-		num_spooled, target_node);
+	DeleteHash(&sc.working_ignetcfg);
+	DeleteHash(&sc.the_netmap);
+
+	QN_syslog(LOG_NOTICE, "Synchronized %d messages to <%s>\n",
+		  num_spooled, target_node);
 	return(num_spooled);
 }
 
@@ -268,12 +285,13 @@
  */
 void cmd_nsyn(char *argbuf) {
 	int num_spooled;
+	long len;
 	char target_node[256];
 
 	if (CtdlAccessCheck(ac_aide)) return;
 
-	extract_token(target_node, argbuf, 0, '|', sizeof target_node);
-	num_spooled = network_sync_to(target_node);
+	len = extract_token(target_node, argbuf, 0, '|', sizeof target_node);
+	num_spooled = network_sync_to(target_node, len);
 	if (num_spooled >= 0) {
 		cprintf("%d Spooled %d messages.\n", CIT_OK, num_spooled);
 	}
@@ -378,7 +396,9 @@
 /*
  * Bounce a message back to the sender
  */
-void network_bounce(struct CtdlMessage *msg, char *reason) {
+void network_bounce(struct CtdlMessage *msg, char *reason)
+{
+	struct CitContext *CCC = CC;
 	char *oldpath = NULL;
 	char buf[SIZ];
 	char bouncesource[SIZ];
@@ -388,7 +408,7 @@
 	static int serialnum = 0;
 	size_t size;
 
-	syslog(LOG_DEBUG, "entering network_bounce()\n");
+	QNM_syslog(LOG_DEBUG, "entering network_bounce()\n");
 
 	if (msg == NULL) return;
 
@@ -477,7 +497,7 @@
 	/* Clean up */
 	if (valid != NULL) free_recipients(valid);
 	CtdlFreeMessage(msg);
-	syslog(LOG_DEBUG, "leaving network_bounce()\n");
+	QNM_syslog(LOG_DEBUG, "leaving network_bounce()\n");
 }
 
 
@@ -491,12 +511,14 @@
  * 
  * Run through the rooms doing various types of network stuff.
  */
-void network_do_queue(void) {
+void network_do_queue(void)
+{
+	struct CitContext *CCC = CC;
 	static int doing_queue = 0;
 	static time_t last_run = 0L;
 	int full_processing = 1;
-	char *working_ignetcfg;
-	NetMap *the_netmap = NULL;
+	HashList *working_ignetcfg;
+	HashList *the_netmap = NULL;
 	int netmap_changed = 0;
 	roomlists RL;
 
@@ -507,7 +529,7 @@
 	if ( (time(NULL) - last_run) < config.c_net_freq ) {
 		full_processing = 0;
 		syslog(LOG_DEBUG, "Network full processing in %ld seconds.\n",
-			config.c_net_freq - (time(NULL)- last_run)
+		       config.c_net_freq - (time(NULL)- last_run)
 		);
 	}
 
@@ -522,6 +544,7 @@
 	}
 	doing_queue = 1;
 
+	become_session(&networker_spool_CC);
 	begin_critical_section(S_RPLIST);
 	RL.rplist = rplist;
 	rplist = NULL;
@@ -537,7 +560,7 @@
 			return;
 	}
 	/* Load the IGnet Configuration into memory */
-	working_ignetcfg = load_working_ignetcfg();
+	working_ignetcfg = load_ignetcfg();
 
 	/*
 	 * Load the network map and filter list into memory.
@@ -551,14 +574,14 @@
 	 * Go ahead and run the queue
 	 */
 	if (full_processing && !server_shutting_down) {
-		syslog(LOG_DEBUG, "network: loading outbound queue\n");
+		QNM_syslog(LOG_DEBUG, "network: loading outbound queue");
 		CtdlForEachRoom(network_queue_interesting_rooms, &RL);
 	}
 
 	if ((RL.rplist != NULL) && (!server_shutting_down)) {
 		RoomProcList *ptr, *cmp;
 		ptr = RL.rplist;
-		syslog(LOG_DEBUG, "network: running outbound queue\n");
+		QNM_syslog(LOG_DEBUG, "network: running outbound queue");
 		while (ptr != NULL && !server_shutting_down) {
 			
 			cmp = ptr->next;
@@ -586,20 +609,29 @@
 	/* If there is anything in the inbound queue, process it */
 	if (!server_shutting_down) {
 		network_do_spoolin(working_ignetcfg, 
-				   &the_netmap,
+				   the_netmap,
 				   &netmap_changed);
 	}
 
-	/* Save the network map back to disk */
-	write_network_map(the_netmap, netmap_changed);
-
 	/* Free the filter list in memory */
 	free_netfilter_list();
 
+	/* Save the network map back to disk */
+	if (netmap_changed) {
+		StrBuf *MapStr = SerializeNetworkMap(the_netmap);
+		CtdlPutSysConfig(IGNETMAP, SmashStrBuf(&MapStr));
+	}
+
+	/* combine singe message files into one spool entry per remote node. */
 	network_consolidate_spoolout(working_ignetcfg, the_netmap);
-	free(working_ignetcfg);
 
-	syslog(LOG_DEBUG, "network: queue run completed\n");
+	/* shut down. */
+
+	DeleteHash(&the_netmap);
+
+	DeleteHash(&working_ignetcfg);
+
+	QNM_syslog(LOG_DEBUG, "network: queue run completed");
 
 	if (full_processing) {
 		last_run = time(NULL);
@@ -684,8 +716,19 @@
 	 */
 	if (!IsEmptyStr(CCC->net_node)) {
 		network_talking_to(CCC->net_node, strlen(CCC->net_node), NTT_REMOVE);
+		CCC->net_node[0] = '\0';
 	}
 }
+void network_cleanup_function(void)
+{
+	struct CitContext *CCC = CC;
+
+	if (!IsEmptyStr(CCC->net_node)) {
+		network_talking_to(CCC->net_node, strlen(CCC->net_node), NTT_REMOVE);
+		CCC->net_node[0] = '\0';
+	}
+}
+
 
 /*
  * Module entry point
@@ -694,18 +737,25 @@
 {
 	NTTDebugEnabled = n;
 }
+void SetNetQDebugEnabled(const int n)
+{
+	NetQDebugEnabled = n;
+}
 
 CTDL_MODULE_INIT(network)
 {
 	if (!threading)
 	{
+		CtdlFillSystemContext(&networker_spool_CC, "CitNetSpool");
 		CtdlRegisterDebugFlagHook(HKEY("networktalkingto"), SetNTTDebugEnabled, &NTTDebugEnabled);
+		CtdlRegisterDebugFlagHook(HKEY("networkqueue"), SetNetQDebugEnabled, &NetQDebugEnabled);
 		CtdlRegisterCleanupHook(cleanup_nttlist);
-                CtdlRegisterSessionHook(network_logout_hook, EVT_LOGOUT);
+		CtdlRegisterSessionHook(network_cleanup_function, EVT_STOP, PRIO_STOP + 30);
+                CtdlRegisterSessionHook(network_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 10);
 		CtdlRegisterProtoHook(cmd_nsyn, "NSYN", "Synchronize room to node");
 		CtdlRegisterRoomHook(network_room_handler);
 		CtdlRegisterCleanupHook(destroy_network_queue_room_locked);
-		CtdlRegisterSessionHook(network_do_queue, EVT_TIMER);
+		CtdlRegisterSessionHook(network_do_queue, EVT_TIMER, PRIO_QUEUE + 10);
 	}
 	return "network";
 }
diff -Nru citadel-8.11/modules/network/serv_networkclient.c citadel-8.12/modules/network/serv_networkclient.c
--- citadel-8.11/modules/network/serv_networkclient.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/network/serv_networkclient.c	2012-06-26 17:56:25.000000000 +0200
@@ -2,7 +2,7 @@
  * This module handles shared rooms, inter-Citadel mail, and outbound
  * mailing list processing.
  *
- * Copyright (c) 2000-2011 by the citadel.org team
+ * Copyright (c) 2000-2012 by the citadel.org team
  *
  *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -274,7 +274,7 @@
 
 		NW->IO.IOB.TotalSentAlready = 0;
 		TotalSendSize = atol (ChrPtr(NW->IO.IOBuf) + 4);
-		EVN_syslog(LOG_DEBUG, "Expecting to transfer %ld bytes\n", NW->IO.IOB.TotalSendSize);
+		EVN_syslog(LOG_DEBUG, "Expecting to transfer %d bytes\n", TotalSendSize);
 		if (TotalSendSize <= 0) {
 			NW->State = eNUOP - 1;
 		}
@@ -318,6 +318,7 @@
 		{
 			FDIOBufferDelete(&NW->IO.IOB);
 			unlink(ChrPtr(NW->tempFileName));
+			FDIOBufferDelete(&IO->IOB);
 			return eAbort;
 		}
 		StrBufPrintf(NW->IO.SendBuf.Buf, "READ %ld|%ld\n",
@@ -352,6 +353,7 @@
 			NW->IO.IOB.ChunkSize = atol(ChrPtr(NW->IO.IOBuf)+4);
 		return eReadFile;
 	}
+	FDIOBufferDelete(&IO->IOB);
 	return eAbort;
 }
 eNextState NWC_ReadREADBlobDone(AsyncNetworker *NW);
@@ -391,12 +393,11 @@
 	eNextState rc;
 	AsyncIO *IO = &NW->IO;
 /* we don't have any data to debug print here. */
-	if (NW->IO.IOB.TotalSendSize == NW->IO.IOB.TotalSentAlready)
+	if (NW->IO.IOB.TotalSentAlready >= NW->IO.IOB.TotalSendSize)
 	{
 		NW->State ++;
 
 		FDIOBufferDelete(&NW->IO.IOB);
-
 		if (link(ChrPtr(NW->tempFileName), ChrPtr(NW->SpoolFileName)) != 0) {
 			EVN_syslog(LOG_ALERT, 
 			       "Could not link %s to %s: %s\n",
@@ -428,6 +429,7 @@
 {
 	AsyncIO *IO = &NW->IO;
 	NWC_DBG_READ();
+	FDIOBufferDelete(&IO->IOB);
 	if (ChrPtr(NW->IO.IOBuf)[0] != '2')
 		return eTerminateConnection;
 	return eSendReply;
@@ -448,7 +450,7 @@
 		     ChrPtr(NW->node));
 	StrBufStripSlashes(NW->SpoolFileName, 1);
 
-	fd = open(ChrPtr(NW->SpoolFileName), O_RDONLY);
+	fd = open(ChrPtr(NW->SpoolFileName), O_EXCL|O_NONBLOCK|O_RDONLY);
 	if (fd < 0) {
 		if (errno != ENOENT) {
 			EVN_syslog(LOG_CRIT,
@@ -476,6 +478,7 @@
 		NW->State = eQUIT;
 		rc = NWC_SendQUIT(NW);
 		NWC_DBG_SEND();
+		if (fd > 0) close(fd);
 		return rc;
 	}
 	FDIOBufferInit(&NW->IO.IOB, &NW->IO.SendBuf, fd, TotalSendSize);
@@ -489,8 +492,10 @@
 {
 	AsyncIO *IO = &NW->IO;
 	NWC_DBG_READ();
-	if (ChrPtr(NW->IO.IOBuf)[0] != '2')
+	if (ChrPtr(NW->IO.IOBuf)[0] != '2') {
+		FDIOBufferDelete(&IO->IOB);
 		return eAbort;
+	}
 	return eSendReply;
 }
 
@@ -508,6 +513,7 @@
 	NWC_DBG_READ();
 	if (ChrPtr(NW->IO.IOBuf)[0] != '7')
 	{
+		FDIOBufferDelete(&IO->IOB);
 		return eAbort;
 	}
 
@@ -520,7 +526,7 @@
 {
 	AsyncIO *IO = &NW->IO;
 	eNextState rc;
-	if (IO->IOB.TotalSendSize == NW->IO.IOB.TotalSentAlready)
+	if (NW->IO.IOB.TotalSentAlready >= IO->IOB.TotalSendSize)
 	{
 		NW->State ++;
 
@@ -556,6 +562,7 @@
 		EVN_syslog(LOG_DEBUG, "Removing <%s>\n", ChrPtr(NW->SpoolFileName));
 		unlink(ChrPtr(NW->SpoolFileName));
 	}
+	FDIOBufferDelete(&IO->IOB);
 	return eSendReply;
 }
 
@@ -921,97 +928,84 @@
  * Set "full" to nonzero to force a poll of every node, or to zero to poll
  * only nodes to which we have data to send.
  */
-void network_poll_other_citadel_nodes(int full_poll, char *working_ignetcfg)
+void network_poll_other_citadel_nodes(int full_poll, HashList *ignetcfg)
 {
+	const char *key;
+	long len;
+	HashPos *Pos;
+	void *vCfg;
 	AsyncNetworker *NW;
-	StrBuf *CfgData;
-	StrBuf *Line;
 	StrBuf *SpoolFileName;
-	const char *lptr;
-	const char *CfgPtr;
-	int Done;
 	
 	int poll = 0;
 	
-	if ((working_ignetcfg == NULL) || (*working_ignetcfg == '\0')) {
+	if (GetCount(ignetcfg) ==0) {
 		syslog(LOG_DEBUG, "network: no neighbor nodes are configured - not polling.\n");
 		return;
 	}
 	become_session(&networker_client_CC);
 
-	CfgData = NewStrBufPlain(working_ignetcfg, -1);
 	SpoolFileName = NewStrBufPlain(ctdl_netout_dir, -1);
-	Line = NewStrBufPlain(NULL, StrLength(CfgData));
-	Done = 0;
-	CfgPtr = NULL;
-	while (!Done)
+
+	Pos = GetNewHashPos(ignetcfg, 0);
+
+	while (GetNextHashPos(ignetcfg, Pos, &len, &key, &vCfg))
 	{
 		/* Use the string tokenizer to grab one line at a time */
-		StrBufSipLine(Line, CfgData, &CfgPtr);
-		Done = CfgPtr == StrBufNOTNULL;
-		if (StrLength(Line) > 0)
+		if(server_shutting_down)
+			return;/* TODO free stuff*/
+		NodeConf *pNode = (NodeConf*) vCfg;
+		poll = 0;
+		NW = (AsyncNetworker*)malloc(sizeof(AsyncNetworker));
+		memset(NW, 0, sizeof(AsyncNetworker));
+		
+		NW->node = NewStrBufDup(pNode->NodeName);
+		NW->host = NewStrBufDup(pNode->Host);
+		NW->port = NewStrBufDup(pNode->Port);
+		NW->secret = NewStrBufDup(pNode->Secret);
+		
+		if ( (StrLength(NW->node) != 0) && 
+		     (StrLength(NW->secret) != 0) &&
+		     (StrLength(NW->host) != 0) &&
+		     (StrLength(NW->port) != 0))
 		{
-			if(server_shutting_down)
-				return;/* TODO free stuff*/
-			lptr = NULL;
-			poll = 0;
-			NW = (AsyncNetworker*)malloc(sizeof(AsyncNetworker));
-			memset(NW, 0, sizeof(AsyncNetworker));
-			
-			NW->node = NewStrBufPlain(NULL, StrLength(Line));
-			NW->host = NewStrBufPlain(NULL, StrLength(Line));
-			NW->port = NewStrBufPlain(NULL, StrLength(Line));
-			NW->secret = NewStrBufPlain(NULL, StrLength(Line));
-			
-			StrBufExtract_NextToken(NW->node, Line, &lptr, '|');
-			StrBufExtract_NextToken(NW->secret, Line, &lptr, '|');
-			StrBufExtract_NextToken(NW->host, Line, &lptr, '|');
-			StrBufExtract_NextToken(NW->port, Line, &lptr, '|');
-			if ( (StrLength(NW->node) != 0) && 
-			     (StrLength(NW->secret) != 0) &&
-			     (StrLength(NW->host) != 0) &&
-			     (StrLength(NW->port) != 0))
+			poll = full_poll;
+			if (poll == 0)
 			{
-				poll = full_poll;
-				if (poll == 0)
-				{
-					StrBufAppendBufPlain(SpoolFileName, HKEY("/"), 0);
-					StrBufAppendBuf(SpoolFileName, NW->node, 0);
-					StrBufStripSlashes(SpoolFileName, 1);
-
-					if (access(ChrPtr(SpoolFileName), R_OK) == 0) {
-						poll = 1;
-					}
+				StrBufAppendBufPlain(SpoolFileName, HKEY("/"), 0);
+				StrBufAppendBuf(SpoolFileName, NW->node, 0);
+				StrBufStripSlashes(SpoolFileName, 1);
+				
+				if (access(ChrPtr(SpoolFileName), R_OK) == 0) {
+					poll = 1;
 				}
 			}
-			if (poll && 
-			    (StrLength(NW->host) > 0) && 
-			    strcmp("0.0.0.0", ChrPtr(NW->host)))
+		}
+		if (poll && 
+		    (StrLength(NW->host) > 0) && 
+		    strcmp("0.0.0.0", ChrPtr(NW->host)))
+		{
+			NW->Url = NewStrBuf();
+			StrBufPrintf(NW->Url, "citadel://:%s@%s:%s", 
+				     ChrPtr(NW->secret),
+				     ChrPtr(NW->host),
+				     ChrPtr(NW->port));
+			if (!network_talking_to(SKEY(NW->node), NTT_CHECK))
 			{
-				NW->Url = NewStrBufPlain(NULL, StrLength(Line));
-				StrBufPrintf(NW->Url, "citadel://:%s@%s:%s", 
-					     ChrPtr(NW->secret),
-					     ChrPtr(NW->host),
-					     ChrPtr(NW->port));
-				if (!network_talking_to(SKEY(NW->node), NTT_CHECK))
-				{
-					RunNetworker(NW);
-					continue;
-				}
+				RunNetworker(NW);
+				continue;
 			}
-			DeleteNetworker(NW);
 		}
+		DeleteNetworker(NW);
 	}
 	FreeStrBuf(&SpoolFileName);
-	FreeStrBuf(&CfgData);
-	FreeStrBuf(&Line);
-
+	DeleteHashPos(&Pos);
 }
 
 
 void network_do_clientqueue(void)
 {
-	char *working_ignetcfg;
+	HashList *working_ignetcfg;
 	int full_processing = 1;
 	static time_t last_run = 0L;
 
@@ -1026,15 +1020,14 @@
 		);
 	}
 
-	working_ignetcfg = load_working_ignetcfg();
+	working_ignetcfg = load_ignetcfg();
 	/*
 	 * Poll other Citadel nodes.  Maybe.  If "full_processing" is set
 	 * then we poll everyone.  Otherwise we only poll nodes we have stuff
 	 * to send to.
 	 */
 	network_poll_other_citadel_nodes(full_processing, working_ignetcfg);
-	if (working_ignetcfg)
-		free(working_ignetcfg);
+	DeleteHash(&working_ignetcfg);
 }
 
 void LogDebugEnableNetworkClient(const int n)
@@ -1050,7 +1043,7 @@
 	{
 		CtdlFillSystemContext(&networker_client_CC, "CitNetworker");
 		
-		CtdlRegisterSessionHook(network_do_clientqueue, EVT_TIMER);
+		CtdlRegisterSessionHook(network_do_clientqueue, EVT_TIMER, PRIO_SEND + 10);
 		CtdlRegisterDebugFlagHook(HKEY("networkclient"), LogDebugEnableNetworkClient, &NetworkClientDebugEnabled);
 
 	}
diff -Nru citadel-8.11/modules/network/serv_network.h citadel-8.12/modules/network/serv_network.h
--- citadel-8.11/modules/network/serv_network.h	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/network/serv_network.h	2012-06-26 17:56:25.000000000 +0200
@@ -1,3 +1,34 @@
+/*
+ * Copyright (c) 2000-2012 by the citadel.org team
+ *
+ *  This program is open source software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+extern int NetQDebugEnabled;
+
+#define DBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (NetQDebugEnabled != 0))
+
+#define QN_syslog(LEVEL, FORMAT, ...)				\
+	DBGLOG(LEVEL) syslog(LEVEL,				\
+			     "CC[%d]" FORMAT, \
+			     CCC->cs_pid, __VA_ARGS__)
+
+#define QNM_syslog(LEVEL, FORMAT)				\
+	DBGLOG(LEVEL) syslog(LEVEL,				\
+			     "CC[%d]" FORMAT, \
+			     CCC->cs_pid)
 
 typedef struct namelist namelist;
 
diff -Nru citadel-8.11/modules/newuser/serv_newuser.c citadel-8.12/modules/newuser/serv_newuser.c
--- citadel-8.11/modules/newuser/serv_newuser.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/newuser/serv_newuser.c	2012-06-26 17:56:25.000000000 +0200
@@ -110,7 +110,7 @@
 {
 	if (!threading)
 	{
-		CtdlRegisterSessionHook(CopyNewUserGreetings, EVT_LOGIN);
+		CtdlRegisterSessionHook(CopyNewUserGreetings, EVT_LOGIN, PRIO_LOGIN + 1);
 	}
 	
 	/* return our module name for the log */
diff -Nru citadel-8.11/modules/openid/serv_openid_rp.c citadel-8.12/modules/openid/serv_openid_rp.c
--- citadel-8.11/modules/openid/serv_openid_rp.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/openid/serv_openid_rp.c	2012-06-26 17:56:25.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  * This is an implementation of OpenID 2.0 relying party support in stateless mode.
  *
- * Copyright (c) 2007-2011 by the citadel.org team
+ * Copyright (c) 2007-2012 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -816,7 +816,6 @@
 		return;
 	}
 	memset(oiddata, 0, sizeof(ctdl_openid));
-	CCC->openid_data = (void *) oiddata;
 
 	ArgBuf = NewStrBufPlain(argbuf, -1);
 
@@ -1130,7 +1129,7 @@
 CTDL_MODULE_INIT(openid_rp)
 {
 	if (!threading) {
-		curl_global_init(CURL_GLOBAL_ALL);
+// evcurl call this for us. curl_global_init(CURL_GLOBAL_ALL);
 
 		/* Only enable the OpenID command set when native mode authentication is in use. */
 		if (config.c_auth_mode == AUTHMODE_NATIVE) {
@@ -1141,7 +1140,7 @@
 			CtdlRegisterProtoHook(cmd_oidc, "OIDC", "Create new user after validating OpenID");
 			CtdlRegisterProtoHook(cmd_oida, "OIDA", "List all OpenIDs in the database");
 		}
-		CtdlRegisterSessionHook(openid_cleanup_function, EVT_LOGOUT);
+		CtdlRegisterSessionHook(openid_cleanup_function, EVT_LOGOUT, PRIO_LOGOUT + 10);
 		CtdlRegisterUserHook(openid_purge, EVT_PURGEUSER);
 		openid_level_supported = 1;	/* This module supports OpenID 1.0 only */
 	}
diff -Nru citadel-8.11/modules/pop3/serv_pop3.c citadel-8.12/modules/pop3/serv_pop3.c
--- citadel-8.11/modules/pop3/serv_pop3.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/pop3/serv_pop3.c	2012-06-26 17:56:25.000000000 +0200
@@ -679,7 +679,7 @@
 					NULL,
 					CitadelServicePop3S);
 #endif
-		CtdlRegisterSessionHook(pop3_cleanup_function, EVT_STOP);
+		CtdlRegisterSessionHook(pop3_cleanup_function, EVT_STOP, PRIO_STOP + 30);
 	}
 	
 	/* return our module name for the log */
diff -Nru citadel-8.11/modules/pop3client/serv_pop3client.c citadel-8.12/modules/pop3client/serv_pop3client.c
--- citadel-8.11/modules/pop3client/serv_pop3client.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/pop3client/serv_pop3client.c	2012-06-26 17:56:25.000000000 +0200
@@ -71,6 +71,16 @@
 			     "IO[%ld]CC[%d][%ld]" FORMAT,		\
 			     IO->ID, CCID, N)
 
+#define EVP3CQ_syslog(LEVEL, FORMAT, ...)				\
+	DBGLOG(LEVEL) syslog(LEVEL,					\
+			     "P3Q:" FORMAT,				\
+			     __VA_ARGS__)
+
+#define EVP3CQM_syslog(LEVEL, FORMAT)					\
+	DBGLOG(LEVEL) syslog(LEVEL,					\
+			     "P3Q" FORMAT				\
+		)
+
 #define EVP3CCS_syslog(LEVEL, FORMAT, ...)				\
 	DBGLOG(LEVEL) syslog(LEVEL, "IO[%ld][%ld]" FORMAT,		\
 			     IO->ID, N, __VA_ARGS__)
@@ -150,6 +160,8 @@
 	AsyncIO	 IO;
 
 	long n;
+	double IOStart;
+	long count;
 	long RefCount;
 	DNSQueryParts HostLookup;
 
@@ -192,14 +204,21 @@
 eNextState FinalizePOP3AggrRun(AsyncIO *IO)
 {
 	HashPos  *It;
-	pop3aggr *cptr = (pop3aggr *)IO->Data;
+	pop3aggr *cpptr = (pop3aggr *)IO->Data;
 
-	EVP3CM_syslog(LOG_DEBUG, "Terminating Aggregator; bye.\n");
+	EVP3C_syslog(LOG_INFO,
+		     "%s@%s: fetched %ld new of %d messages in %fs. bye.",
+		     ChrPtr(cpptr->pop3user),
+		     ChrPtr(cpptr->pop3pass),
+		     cpptr->count,
+		     GetCount(cpptr->MsgNumbers), 
+		     IO->Now - cpptr->IOStart 
+		);
 
 	It = GetNewHashPos(POP3FetchUrls, 0);
 	pthread_mutex_lock(&POP3QueueMutex);
 	{
-		if (GetHashPosFromKey(POP3FetchUrls, SKEY(cptr->Url), It))
+		if (GetHashPosFromKey(POP3FetchUrls, SKEY(cpptr->Url), It))
 			DeleteEntryFromHash(POP3FetchUrls, It);
 	}
 	pthread_mutex_unlock(&POP3QueueMutex);
@@ -319,14 +338,14 @@
 #if 0
 	rc = TestValidateHash(RecvMsg->MsgNumbers);
 	if (rc != 0)
-		syslog(LOG_DEBUG, "Hash Invalid: %d\n", rc);
+		EVP3CCS_syslog(LOG_DEBUG, "Hash Invalid: %d\n", rc);
 #endif
 
 	Put(RecvMsg->MsgNumbers, LKEY(OneMsg->MSGID), OneMsg, HfreeFetchItem);
 #if 0
 	rc = TestValidateHash(RecvMsg->MsgNumbers);
 	if (rc != 0)
-		syslog(LOG_DEBUG, "Hash Invalid: %d\n", rc);
+		EVP3CCS_syslog(LOG_DEBUG, "Hash Invalid: %d\n", rc);
 #endif
 	//RecvMsg->State --; /* read next Line */
 	return eReadMore;
@@ -351,9 +370,9 @@
 			return eAbort;
 
 		RecvMsg->CurrMsg = (FetchItem*) vData;
-		syslog(LOG_DEBUG,
-		       "CHECKING: whether %s has already been seen: ",
-		       ChrPtr(RecvMsg->CurrMsg->MsgUID));
+		EVP3CCS_syslog(LOG_DEBUG,
+			       "CHECKING: whether %s has already been seen: ",
+			       ChrPtr(RecvMsg->CurrMsg->MsgUID));
 
 		/* Find out if we've already seen this item */
 		safestrncpy(ut.ut_msgid,
@@ -364,7 +383,7 @@
 		cdbut = cdb_fetch(CDB_USETABLE, SKEY(RecvMsg->CurrMsg->MsgUID));
 		if (cdbut != NULL) {
 			/* Item has already been seen */
-			syslog(LOG_DEBUG, "YES\n");
+			EVP3CCSM_syslog(LOG_DEBUG, "YES\n");
 			cdb_free(cdbut);
 
 			/* rewrite the record anyway, to update the timestamp */
@@ -375,7 +394,7 @@
 		}
 		else
 		{
-			syslog(LOG_DEBUG, "NO\n");
+			EVP3CCSM_syslog(LOG_DEBUG, "NO\n");
 			RecvMsg->CurrMsg->NeedFetch = 1;
 		}
 		return NextDBOperation(&RecvMsg->IO,
@@ -402,7 +421,7 @@
 	int rc;
 	rc = TestValidateHash(RecvMsg->MsgNumbers);
 	if (rc != 0)
-		syslog(LOG_DEBUG, "Hash Invalid: %d\n", rc);
+		EVP3CCS_syslog(LOG_DEBUG, "Hash Invalid: %d\n", rc);
 #endif
 	if(GetNextHashPos(RecvMsg->MsgNumbers,
 			  RecvMsg->Pos,
@@ -435,7 +454,7 @@
 	int rc;
 	rc = TestValidateHash(RecvMsg->MsgNumbers);
 	if (rc != 0)
-		syslog(LOG_DEBUG, "Hash Invalid: %d\n", rc);
+		EVP3CCS_syslog(LOG_DEBUG, "Hash Invalid: %d\n", rc);
 #endif
 
 	POP3C_DBG_READ();
@@ -511,9 +530,9 @@
 	pop3aggr *RecvMsg = (pop3aggr *) IO->Data;
 	struct UseTable ut;
 
-	syslog(LOG_DEBUG,
-	       "MARKING: %s as seen: ",
-	       ChrPtr(RecvMsg->CurrMsg->MsgUID));
+	EVP3CCS_syslog(LOG_DEBUG,
+		       "MARKING: %s as seen: ",
+		       ChrPtr(RecvMsg->CurrMsg->MsgUID));
 
 	safestrncpy(ut.ut_msgid,
 		    ChrPtr(RecvMsg->CurrMsg->MsgUID),
@@ -546,6 +565,7 @@
 	}
 	CtdlFreeMessage(RecvMsg->CurrMsg->Msg);
 
+	RecvMsg->count ++;
 	return NextDBOperation(&RecvMsg->IO, POP3C_StoreMsgRead);
 }
 
@@ -555,7 +575,7 @@
 	EVP3CM_syslog(LOG_DEBUG, "Converting message...");
 	RecvMsg->CurrMsg->Msg =
 		convert_internet_message_buf(&RecvMsg->IO.ReadMsg->MsgBuf);
-	StopClientWatchers(IO);
+	StopClientWatchers(IO, 0);
 	return QueueDBOperation(&RecvMsg->IO, POP3C_SaveMsg);
 }
 
@@ -714,7 +734,7 @@
 }
 eNextState POP3_C_DispatchReadDone(AsyncIO *IO)
 {
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+/*	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__); to noisy anyways. */
 	pop3aggr *pMsg = IO->Data;
 	eNextState rc;
 
@@ -726,10 +746,10 @@
 }
 eNextState POP3_C_DispatchWriteDone(AsyncIO *IO)
 {
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 	pop3aggr *pMsg = IO->Data;
 	eNextState rc;
 
+/*	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__); to noisy anyways. */
 	rc = POP3C_SendHandlers[pMsg->State](pMsg);
 	POP3SetTimeout(rc, pMsg);
 	return rc;
@@ -743,7 +763,7 @@
 {
 ///	pop3aggr *pMsg = (pop3aggr *)IO->Data;
 
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 	FinalizePOP3AggrRun(IO);
 	return eAbort;
 }
@@ -751,7 +771,7 @@
 {
 ///	pop3aggr *pMsg = (pop3aggr *)IO->Data;
 
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 	FinalizePOP3AggrRun(IO);
 	return eAbort;
 }
@@ -759,7 +779,7 @@
 {
 	pop3aggr *pMsg = IO->Data;
 
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 	StrBufPlain(IO->ErrMsg, CKEY(POP3C_ReadErrors[pMsg->State]));
 	return FailAggregationRun(IO);
 }
@@ -767,7 +787,7 @@
 {
 	pop3aggr *pMsg = (pop3aggr *)IO->Data;
 
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 	StrBufPlain(IO->ErrMsg, CKEY(POP3C_ReadErrors[pMsg->State]));
 	return FailAggregationRun(IO);
 }
@@ -775,13 +795,13 @@
 {
 	pop3aggr *pMsg = (pop3aggr *)IO->Data;
 
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 	StrBufPlain(IO->ErrMsg, CKEY(POP3C_ReadErrors[pMsg->State]));
 	return FailAggregationRun(IO);
 }
 eNextState POP3_C_Shutdown(AsyncIO *IO)
 {
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 ////	pop3aggr *pMsg = IO->Data;
 
 ////pMsg->MyQEntry->Status = 3;
@@ -830,7 +850,7 @@
 {
 	pop3aggr *cpptr = IO->Data;
 
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 ////???	cpptr->State ++;
 	if (cpptr->Pos == NULL)
 		cpptr->Pos = GetNewHashPos(cpptr->MsgNumbers, 0);
@@ -843,7 +863,12 @@
 
 eNextState pop3_connect_ip(AsyncIO *IO)
 {
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+	pop3aggr *cpptr = IO->Data;
+
+	if (cpptr->IOStart == 0.0) /* whith or without DNS? */
+		cpptr->IOStart = IO->Now;
+
+	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 
 	return EvConnectSock(IO,
 			     POP3_C_ConnTimeout,
@@ -894,14 +919,16 @@
 {
 	pop3aggr *cpptr = IO->Data;
 
-	syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+	cpptr->IOStart = IO->Now;
+
+	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
 
-	syslog(LOG_DEBUG, 
-		      "POP3 client[%ld]: looking up %s-Record %s : %d ...\n",
-		      cpptr->n,
-		      (cpptr->IO.ConnectMe->IPv6)? "aaaa": "a",
-		      cpptr->IO.ConnectMe->Host,
-		      cpptr->IO.ConnectMe->Port);
+	EVP3CCS_syslog(LOG_DEBUG, 
+		       "POP3 client[%ld]: looking up %s-Record %s : %d ...\n",
+		       cpptr->n,
+		       (cpptr->IO.ConnectMe->IPv6)? "aaaa": "a",
+		       cpptr->IO.ConnectMe->Host,
+		       cpptr->IO.ConnectMe->Port);
 
 	QueueQuery((cpptr->IO.ConnectMe->IPv6)? ns_t_aaaa : ns_t_a,
 		   cpptr->IO.ConnectMe->Host,
@@ -969,11 +996,12 @@
 	pthread_mutex_lock(&POP3QueueMutex);
 	if (GetHash(POP3QueueRooms, LKEY(qrbuf->QRnumber), &vptr))
 	{
-		syslog(LOG_DEBUG,
-			      "pop3client: [%ld] %s already in progress.\n",
+		pthread_mutex_unlock(&POP3QueueMutex);
+		EVP3CQ_syslog(LOG_DEBUG,
+			      "pop3client: [%ld] %s already in progress.",
 			      qrbuf->QRnumber,
 			      qrbuf->QRname);
-		pthread_mutex_unlock(&POP3QueueMutex);
+		return;
 	}
 	pthread_mutex_unlock(&POP3QueueMutex);
 
@@ -992,10 +1020,10 @@
 	if (server_shutting_down)
 		return;
 	if (fstat(fd, &statbuf) == -1) {
-		syslog(LOG_DEBUG,
-		       "ERROR: could not stat configfile '%s' - %s\n",
-		       filename,
-		       strerror(errno));
+		EVP3CQ_syslog(LOG_INFO,
+			      "ERROR: could not stat configfile '%s' - %s",
+			      filename,
+			      strerror(errno));
 		return;
 	}
 	if (server_shutting_down)
@@ -1004,7 +1032,8 @@
 	if (StrBufReadBLOB(CfgData, &fd, 1, statbuf.st_size, &Err) < 0) {
 		close(fd);
 		FreeStrBuf(&CfgData);
-		syslog(LOG_DEBUG, "ERROR: reading config '%s' - %s<br>\n",
+		EVP3CQ_syslog(LOG_INFO,
+			      "ERROR: reading config '%s' - %s",
 			      filename, strerror(errno));
 		return;
 	}
@@ -1176,7 +1205,7 @@
 	if (doing_pop3client) return;
 	doing_pop3client = 1;
 
-	syslog(LOG_DEBUG, "pop3client started");
+	EVP3CQM_syslog(LOG_DEBUG, "pop3client started");
 	CtdlForEachRoom(pop3client_scan_room, NULL);
 
 	pthread_mutex_lock(&POP3QueueMutex);
@@ -1202,7 +1231,7 @@
 	DeleteHashPos(&it);
 	pthread_mutex_unlock(&POP3QueueMutex);
 
-	syslog(LOG_DEBUG, "pop3client ended");
+	EVP3CQM_syslog(LOG_DEBUG, "pop3client ended");
 	last_run = time(NULL);
 	doing_pop3client = 0;
 }
@@ -1231,7 +1260,7 @@
 		pthread_mutex_init(&POP3QueueMutex, NULL);
 		POP3QueueRooms = NewHash(1, lFlathash);
 		POP3FetchUrls = NewHash(1, NULL);
-		CtdlRegisterSessionHook(pop3client_scan, EVT_TIMER);
+		CtdlRegisterSessionHook(pop3client_scan, EVT_TIMER, PRIO_AGGR + 50);
 		CtdlRegisterEVCleanupHook(pop3_cleanup);
 		CtdlRegisterDebugFlagHook(HKEY("pop3client"), LogDebugEnablePOP3Client, &POP3ClientDebugEnabled);
 	}
diff -Nru citadel-8.11/modules/roomchat/serv_roomchat.c citadel-8.12/modules/roomchat/serv_roomchat.c
--- citadel-8.11/modules/roomchat/serv_roomchat.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/roomchat/serv_roomchat.c	2012-06-26 17:56:25.000000000 +0200
@@ -267,8 +267,8 @@
 	if (!threading)
 	{
 		CtdlRegisterProtoHook(cmd_rcht, "RCHT", "Participate in real time chat in a room");
-		CtdlRegisterSessionHook(roomchat_timer, EVT_TIMER);
-		CtdlRegisterSessionHook(roomchat_shutdown, EVT_SHUTDOWN);
+		CtdlRegisterSessionHook(roomchat_timer, EVT_TIMER, PRIO_CLEANUP + 400);
+		CtdlRegisterSessionHook(roomchat_shutdown, EVT_SHUTDOWN, PRIO_SHUTDOWN + 55);
 	}
 	
 	/* return our module name for the log */
diff -Nru citadel-8.11/modules/rssclient/rss_atom_parser.c citadel-8.12/modules/rssclient/rss_atom_parser.c
--- citadel-8.11/modules/rssclient/rss_atom_parser.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/rssclient/rss_atom_parser.c	2012-06-26 17:56:25.000000000 +0200
@@ -777,7 +777,7 @@
 
 	msglen += 1024 + StrLength(ri->link) + StrLength(ri->description) ;
 
-	Message = NewStrBufPlain(NULL, StrLength(ri->description));
+	Message = NewStrBufPlain(NULL, msglen);
 
 	StrBufPlain(Message, HKEY(
 			    "Content-type: text/html; charset=\"UTF-8\"\r\n\r\n"
diff -Nru citadel-8.11/modules/rssclient/serv_rssclient.c citadel-8.12/modules/rssclient/serv_rssclient.c
--- citadel-8.11/modules/rssclient/serv_rssclient.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/rssclient/serv_rssclient.c	2012-06-26 17:56:25.000000000 +0200
@@ -224,7 +224,7 @@
 
 	EVRSSC_syslog(LOG_DEBUG, "RSS: Aborting by shutdown: %s.\n", pUrl);
 
-
+	StopCurlWatchers(IO);
 	UnlinkRSSAggregator(RSSAggr);
 	return eAbort;
 }
@@ -592,7 +592,7 @@
 		RSSQueueRooms = NewHash(1, lFlathash);
 		RSSFetchUrls = NewHash(1, NULL);
 		syslog(LOG_INFO, "%s\n", curl_version());
-		CtdlRegisterSessionHook(rssclient_scan, EVT_TIMER);
+		CtdlRegisterSessionHook(rssclient_scan, EVT_TIMER, PRIO_AGGR + 300);
 		CtdlRegisterEVCleanupHook(rss_cleanup);
 		CtdlRegisterDebugFlagHook(HKEY("rssclient"), LogDebugEnableRSSClient, &RSSClientDebugEnabled);
 	}
diff -Nru citadel-8.11/modules/sieve/serv_sieve.c citadel-8.12/modules/sieve/serv_sieve.c
--- citadel-8.11/modules/sieve/serv_sieve.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/sieve/serv_sieve.c	2012-06-26 17:56:25.000000000 +0200
@@ -1354,7 +1354,7 @@
 		ctdl_sieve_init();
 		CtdlRegisterProtoHook(cmd_msiv, "MSIV", "Manage Sieve scripts");
 	        CtdlRegisterRoomHook(serv_sieve_room);
-        	CtdlRegisterSessionHook(perform_sieve_processing, EVT_HOUSE);
+        	CtdlRegisterSessionHook(perform_sieve_processing, EVT_HOUSE, PRIO_HOUSE + 10);
 		CtdlRegisterCleanupHook(cleanup_sieve);
 	}
 	
diff -Nru citadel-8.11/modules/smtp/serv_smtp.c citadel-8.12/modules/smtp/serv_smtp.c
--- citadel-8.11/modules/smtp/serv_smtp.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/smtp/serv_smtp.c	2012-06-26 17:56:25.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * This module is an SMTP and ESMTP implementation for the Citadel system.
+ * This module is an SMTP and ESMTP server for the Citadel system.
  * It is compliant with all of the following:
  *
  * RFC  821 - Simple Mail Transfer Protocol
@@ -25,16 +25,10 @@
  *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 3.
  *  
- *  
- *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
- *
- *  
- *  
- *  
  */
 
 #include "sysdep.h"
@@ -102,14 +96,6 @@
 };
 
 
-
-
-
-/*****************************************************************************/
-/*                      SMTP SERVER (INBOUND) STUFF                          */
-/*****************************************************************************/
-
-
 /*
  * Here's where our SMTP session begins its happy day.
  */
@@ -590,11 +576,11 @@
 		}
 	}
 
-	valid = validate_recipients(recp, 
-				    smtp_get_Recipients (),
-				    (sSMTP->is_lmtp)? POST_LMTP:
-				       (CC->logged_in)? POST_LOGGED_IN:
-				                        POST_EXTERNAL);
+	valid = validate_recipients(
+		recp, 
+		smtp_get_Recipients(),
+		(sSMTP->is_lmtp)? POST_LMTP: (CC->logged_in)? POST_LOGGED_IN: POST_EXTERNAL
+	);
 	if (valid->num_error != 0) {
 		cprintf("550 %s\r\n", valid->errormsg);
 		free_recipients(valid);
@@ -730,11 +716,11 @@
 	msg->cm_fields['V'] = strdup(sSMTP->recipients);
 
 	/* Submit the message into the Citadel system. */
-	valid = validate_recipients(sSMTP->recipients, 
-				    smtp_get_Recipients (),
-				    (sSMTP->is_lmtp)? POST_LMTP:
-				       (CC->logged_in)? POST_LOGGED_IN:
-				                        POST_EXTERNAL);
+	valid = validate_recipients(
+		sSMTP->recipients,
+		smtp_get_Recipients(),
+		(sSMTP->is_lmtp)? POST_LMTP: (CC->logged_in)? POST_LOGGED_IN: POST_EXTERNAL
+	);
 
 	/* If there are modules that want to scan this message before final
 	 * submission (such as virus checkers or spam filters), call them now
@@ -766,7 +752,7 @@
 		}
 	}
 
-	/* For SMTP and ESTMP, just print the result message.  For LMTP, we
+	/* For SMTP and ESMTP, just print the result message.  For LMTP, we
 	 * have to print one result message for each recipient.  Since there
 	 * is nothing in Citadel which would cause different recipients to
 	 * have different results, we can get away with just spitting out the
@@ -802,7 +788,7 @@
 
 
 /*
- * implements the STARTTLS command (Citadel API version)
+ * implements the STARTTLS command
  */
 void smtp_starttls(void)
 {
@@ -810,20 +796,16 @@
 	char nosup_response[SIZ];
 	char error_response[SIZ];
 
-	sprintf(ok_response,
-		"220 Begin TLS negotiation now\r\n");
-	sprintf(nosup_response,
-		"554 TLS not supported here\r\n");
-	sprintf(error_response,
-		"554 Internal error\r\n");
+	sprintf(ok_response, "220 Begin TLS negotiation now\r\n");
+	sprintf(nosup_response, "554 TLS not supported here\r\n");
+	sprintf(error_response, "554 Internal error\r\n");
 	CtdlModuleStartCryptoMsgs(ok_response, nosup_response, error_response);
 	smtp_rset(0);
 }
 
 
-
 /* 
- * Main command loop for SMTP sessions.
+ * Main command loop for SMTP server sessions.
  */
 void smtp_command_loop(void) {
 	char cmdbuf[SIZ];
@@ -831,6 +813,7 @@
 
 	if (sSMTP == NULL) {
 		syslog(LOG_EMERG, "Session SMTP data is null.  WTF?  We will crash now.\n");
+		return cit_panic_backtrace (0);
 	}
 
 	time(&CC->lastcmd);
@@ -913,12 +896,6 @@
 }
 
 
-
-
-
-
-
-
 /*****************************************************************************/
 /*                      MODULE INITIALIZATION STUFF                          */
 /*****************************************************************************/
@@ -984,7 +961,7 @@
 					NULL,
 					CitadelServiceSMTP_LMTP_UNF);
 
-		CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP);
+		CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP, PRIO_STOP + 250);
 	}
 	
 	/* return our module name for the log */
diff -Nru citadel-8.11/modules/smtp/serv_smtpeventclient.c citadel-8.12/modules/smtp/serv_smtpeventclient.c
--- citadel-8.11/modules/smtp/serv_smtpeventclient.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/smtp/serv_smtpeventclient.c	2012-06-26 17:56:25.000000000 +0200
@@ -91,12 +91,11 @@
 #include "smtp_clienthandlers.h"
 
 int SMTPClientDebugEnabled = 0;
-const unsigned short DefaultMXPort = 25;
 void DeleteSmtpOutMsg(void *v)
 {
 	SmtpOutMsg *Msg = v;
 	AsyncIO *IO = &Msg->IO;
-	EVS_syslog(LOG_DEBUG, "%s Exit\n", __FUNCTION__);
+	EV_syslog(LOG_DEBUG, "%s Exit\n", __FUNCTION__);
 
 	/* these are kept in our own space and free'd below */
 	Msg->IO.ConnectMe = NULL;
@@ -234,7 +233,7 @@
 	 * - connection timeout
 	 * - dns lookup failed
 	 */
-	StopClientWatchers(IO);
+	StopClientWatchers(IO, 1);
 
 	if (Msg->pCurrRelay != NULL)
 		Msg->pCurrRelay = Msg->pCurrRelay->Next;
@@ -322,6 +321,8 @@
 	SmtpOutMsg *Msg = IO->Data;
 	struct hostent *hostent;
 
+	IO->ConnectMe = Msg->pCurrRelay;
+
 	QueryCbDone(IO);
 	EVS_syslog(LOG_DEBUG, "%s Time[%fs]\n",
 		   __FUNCTION__,
@@ -339,7 +340,7 @@
 			Msg->pCurrRelay->Addr.sin6_family =
 				hostent->h_addrtype;
 			Msg->pCurrRelay->Addr.sin6_port =
-				htons(DefaultMXPort);
+				htons(Msg->IO.ConnectMe->Port);
 		}
 		else {
 			struct sockaddr_in *addr;
@@ -357,7 +358,7 @@
 			       sizeof(uint32_t));
 
 			addr->sin_family = hostent->h_addrtype;
-			addr->sin_port   = htons(DefaultMXPort);
+			addr->sin_port   = htons(Msg->IO.ConnectMe->Port);
 		}
 		Msg->mx_host = Msg->pCurrRelay->Host;
 		if (Msg->HostLookup.VParsedDNSReply != NULL) {
@@ -530,6 +531,8 @@
 	SmtpOutMsg * Msg;
 
 	Msg = (SmtpOutMsg *) malloc(sizeof(SmtpOutMsg));
+	if (Msg == NULL)
+		return NULL;
 	memset(Msg, 0, sizeof(SmtpOutMsg));
 
 	Msg->n                = MsgCount;
@@ -567,6 +570,12 @@
 	SMTPC_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
 
 	Msg = new_smtp_outmsg(MyQItem, MyQEntry, MsgCount);
+	if (Msg == NULL) {
+		SMTPC_syslog(LOG_DEBUG, "%s Failed to alocate message context.\n", __FUNCTION__);
+		if (KeepMsgText) 
+			FreeStrBuf (&MsgText);
+		return;
+	}
 	if (KeepMsgText) Msg->msgtext = MsgText;
 	else		 Msg->msgtext = NewStrBufDup(MsgText);
 
@@ -600,8 +609,7 @@
 	}
 	else {
 		/* No recipients? well fail then. */
-		if ((Msg==NULL) ||
-		    (Msg->MyQEntry == NULL)) {
+		if (Msg->MyQEntry != NULL) {
 			Msg->MyQEntry->Status = 5;
 			StrBufPlain(Msg->MyQEntry->StatusMessage,
 				    HKEY("Invalid Recipient!"));
diff -Nru citadel-8.11/modules/smtp/serv_smtpqueue.c citadel-8.12/modules/smtp/serv_smtpqueue.c
--- citadel-8.11/modules/smtp/serv_smtpqueue.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/smtp/serv_smtpqueue.c	2012-06-26 17:56:25.000000000 +0200
@@ -94,6 +94,7 @@
 pthread_mutex_t ActiveQItemsLock;
 HashList *ActiveQItems  = NULL;
 HashList *QItemHandlers = NULL;
+const unsigned short DefaultMXPort = 25;
 int max_sessions_for_outbound_smtp = 500; /* how many sessions might be active till we stop adding more smtp jobs */
 int ndelay_count = 50; /* every n queued messages we will sleep... */
 int delay_msec = 5000; /* this many seconds. */
@@ -829,7 +830,7 @@
 				!IsEmptyStr(Pos)))
 			{
 				StrBufExtract_NextToken(One, All, &Pos, '|');
-				if (!ParseURL(Url, One, 25)) {
+				if (!ParseURL(Url, One, DefaultMXPort)) {
 					SMTPC_syslog(LOG_DEBUG,
 						     "Failed to parse: %s\n",
 						     ChrPtr(One));
@@ -857,7 +858,7 @@
 				!IsEmptyStr(Pos)))
 			{
 				StrBufExtract_NextToken(One, All, &Pos, '|');
-				if (!ParseURL(Url, One, 25)) {
+				if (!ParseURL(Url, One, DefaultMXPort)) {
 					SMTPC_syslog(LOG_DEBUG,
 						     "Failed to parse: %s\n",
 						     ChrPtr(One));
@@ -1003,14 +1004,9 @@
  * Run through the queue sending out messages.
  */
 void smtp_do_queue(void) {
-	static int is_running = 0;
 	int num_processed = 0;
 	int num_activated = 0;
 
-	if (is_running)
-		return;	/* Concurrency check - only one can run */
-	is_running = 1;
-
 	pthread_setspecific(MyConKey, (void *)&smtp_queue_CC);
 	SMTPCM_syslog(LOG_INFO, "processing outbound queue");
 
@@ -1030,8 +1026,6 @@
 		     "queue run completed; %d messages processed %d activated",
 		     num_processed, num_activated);
 
-	run_queue_now = 0;
-	is_running = 0;
 }
 
 
@@ -1143,7 +1137,7 @@
 		CtdlRegisterEVCleanupHook(smtp_evq_cleanup);
 
 		CtdlRegisterProtoHook(cmd_smtp, "SMTP", "SMTP utility commands");
-		CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
+		CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER, PRIO_SEND + 10);
 	}
 
 	/* return our Subversion id for the Log */
diff -Nru citadel-8.11/modules/smtp/smtpqueue.h citadel-8.12/modules/smtp/smtpqueue.h
--- citadel-8.11/modules/smtp/smtpqueue.h	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/smtp/smtpqueue.h	2012-06-26 17:56:25.000000000 +0200
@@ -22,6 +22,7 @@
 /*****************************************************************************/
 
 #define MaxAttempts 15
+extern const unsigned short DefaultMXPort;
 
 typedef struct _mailq_entry {
 	StrBuf *Recipient;
diff -Nru citadel-8.11/modules/test/serv_test.c citadel-8.12/modules/test/serv_test.c
--- citadel-8.11/modules/test/serv_test.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/test/serv_test.c	2012-06-26 17:56:25.000000000 +0200
@@ -74,10 +74,10 @@
 	if (!threading)
 	{
 		CtdlRegisterCleanupHook(CleanupTest);
-		CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
-		CtdlRegisterSessionHook(SessionStartTest, EVT_START);
-		CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
-		CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
+		CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM, 1);
+		CtdlRegisterSessionHook(SessionStartTest, EVT_START, 1);
+		CtdlRegisterSessionHook(SessionStopTest, EVT_STOP, 1);
+		CtdlRegisterSessionHook(LoginTest, EVT_LOGIN, 1);
 	}
 #endif
 
diff -Nru citadel-8.11/modules/vcard/serv_vcard.c citadel-8.12/modules/vcard/serv_vcard.c
--- citadel-8.11/modules/vcard/serv_vcard.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/vcard/serv_vcard.c	2012-06-26 17:56:25.000000000 +0200
@@ -390,7 +390,7 @@
 		return(1);
 	}
 
-	s = vcard_get_prop(v, "fn", 1, 0, 0);
+	vcard_get_prop(v, "fn", 1, 0, 0);
 
 	if (yes_my_citadel_config) {
 		/* Bingo!  The user is uploading a new vCard, so
@@ -1452,7 +1452,7 @@
 
 	if (!threading)
 	{
-		CtdlRegisterSessionHook(vcard_session_login_hook, EVT_LOGIN);
+		CtdlRegisterSessionHook(vcard_session_login_hook, EVT_LOGIN, PRIO_LOGIN + 70);
 		CtdlRegisterMessageHook(vcard_upload_beforesave, EVT_BEFORESAVE);
 		CtdlRegisterMessageHook(vcard_upload_aftersave, EVT_AFTERSAVE);
 		CtdlRegisterDeleteHook(vcard_delete_remove);
@@ -1466,7 +1466,7 @@
 		CtdlRegisterUserHook(vcard_newuser, EVT_NEWUSER);
 		CtdlRegisterUserHook(vcard_purge, EVT_PURGEUSER);
 		CtdlRegisterNetprocHook(vcard_extract_from_network);
-		CtdlRegisterSessionHook(store_harvested_addresses, EVT_TIMER);
+		CtdlRegisterSessionHook(store_harvested_addresses, EVT_TIMER, PRIO_CLEANUP + 470);
 		CtdlRegisterFixedOutputHook("text/x-vcard", vcard_fixed_output);
 		CtdlRegisterFixedOutputHook("text/vcard", vcard_fixed_output);
 
diff -Nru citadel-8.11/modules/xmpp/serv_xmpp.c citadel-8.12/modules/xmpp/serv_xmpp.c
--- citadel-8.11/modules/xmpp/serv_xmpp.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/modules/xmpp/serv_xmpp.c	2012-06-26 17:56:25.000000000 +0200
@@ -633,11 +633,11 @@
 					CitadelServiceXMPP
 		);
 		CtdlRegisterDebugFlagHook(HKEY("serv_xmpp"), LogXMPPSrvDebugEnable, &XMPPSrvDebugEnable);
-		CtdlRegisterSessionHook(xmpp_cleanup_function, EVT_STOP);
-                CtdlRegisterSessionHook(xmpp_login_hook, EVT_LOGIN);
-                CtdlRegisterSessionHook(xmpp_logout_hook, EVT_LOGOUT);
-                CtdlRegisterSessionHook(xmpp_login_hook, EVT_UNSTEALTH);
-                CtdlRegisterSessionHook(xmpp_logout_hook, EVT_STEALTH);
+		CtdlRegisterSessionHook(xmpp_cleanup_function, EVT_STOP, PRIO_STOP + 70);
+                CtdlRegisterSessionHook(xmpp_login_hook, EVT_LOGIN, PRIO_LOGIN + 90);
+                CtdlRegisterSessionHook(xmpp_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 90);
+                CtdlRegisterSessionHook(xmpp_login_hook, EVT_UNSTEALTH, PRIO_UNSTEALTH + 1);
+                CtdlRegisterSessionHook(xmpp_logout_hook, EVT_STEALTH, PRIO_STEALTH + 1);
 		CtdlRegisterCleanupHook(xmpp_cleanup_events);
 
 	}
diff -Nru citadel-8.11/msgbase.c citadel-8.12/msgbase.c
--- citadel-8.11/msgbase.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/msgbase.c	2012-06-26 17:56:25.000000000 +0200
@@ -93,7 +93,7 @@
 	"hnod",
 	"msgn",
 	"jrnl",
-	NULL,
+	"rep2",
 	"list",
 	"text",
 	"node",
@@ -370,7 +370,7 @@
 	int is_seen = 0;
 	int was_seen = 0;
 	long lo = (-1L);
-	long hi = (-1L);
+	long hi = (-1L); /// TODO: we just write here. y?
 	visit vbuf;
 	long *msglist;
 	int num_msgs = 0;
@@ -1658,7 +1658,7 @@
 ) {
 	struct CitContext *CCC = CC;
 	struct CtdlMessage *TheMessage = NULL;
-	int retcode = om_no_such_msg;
+	int retcode = CIT_OK;
 	struct encapmsg encap;
 	int r;
 
@@ -1748,15 +1748,20 @@
 
 		}
 		else {
-			if (do_proto) cprintf("%d msg %ld has no part %s\n",
-				ERROR + MESSAGE_NOT_FOUND, msg_num, section);
+			if (do_proto) {
+				cprintf("%d msg %ld has no part %s\n",
+					ERROR + MESSAGE_NOT_FOUND,
+					msg_num,
+					section);
+			}
 			retcode = om_no_such_msg;
 		}
 
 	}
 
 	/* Ok, output the message now */
-	retcode = CtdlOutputPreLoadedMsg(TheMessage, mode, headers_only, do_proto, crlf, flags);
+	if (retcode == CIT_OK)
+		retcode = CtdlOutputPreLoadedMsg(TheMessage, mode, headers_only, do_proto, crlf, flags);
 	CtdlFreeMessage(TheMessage);
 
 	return(retcode);
@@ -2178,7 +2183,6 @@
 	}
 	if (outlen > 0) {
 		client_write(outbuf, outlen);
-		outlen = 0;
 	}
 }
 
@@ -2749,6 +2753,8 @@
 	msglist = realloc(msglist, (sizeof(long) * (num_msgs + num_msgs_to_be_merged)) );
 	if (msglist == NULL) {
 		MSGM_syslog(LOG_ALERT, "ERROR: can't realloc message list!\n");
+		free(msgs_to_be_merged);
+		return (ERROR + INTERNAL_ERROR);
 	}
 	memcpy(&msglist[num_msgs], msgs_to_be_merged, (sizeof(long) * num_msgs_to_be_merged) );
 	num_msgs += num_msgs_to_be_merged;
@@ -2979,47 +2985,6 @@
 
 
 /*
- * Serialize a struct CtdlMessage into the format used on disk and network.
- * 
- * This function loads up a "struct ser_ret" (defined in server.h) which
- * contains the length of the serialized message and a pointer to the
- * serialized message in memory.  THE LATTER MUST BE FREED BY THE CALLER.
- */
-void dump_message(struct CtdlMessage *msg,	/* unserialized msg */
-		  long Siz)                     /* how many chars ? */
-{
-	int i;
-	static char *forder = FORDER;
-	char *buf;
-
-	/*
-	 * Check for valid message format
-	 */
-	if (is_valid_message(msg) == 0) {
-		struct CitContext *CCC = CC;
-		MSGM_syslog(LOG_ERR, "dump_message() aborting due to invalid message\n");
-		return;
-	}
-
-	buf = (char*) malloc (Siz + 1);
-
-	for (i=0; i<26; ++i) if (msg->cm_fields[(int)forder[i]] != NULL) {
-			snprintf (buf, Siz, " msg[%c] = %s ...\n", (char) forder[i], 
-				   msg->cm_fields[(int)forder[i]]);
-			if (client_write (buf, strlen(buf)) == -1)
-			{
-				struct CitContext *CCC = CC;
-				MSGM_syslog(LOG_ERR, "dump_message(): aborting due to write failure.\n");
-				return;
-			}
-		}
-
-	return;
-}
-
-
-
-/*
  * Check to see if any messages already exist in the current room which
  * carry the same Exclusive ID as this one.  If any are found, delete them.
  */
@@ -4157,11 +4122,11 @@
 		++num_recps;
 
 		strcpy(org_recp, this_recp);
+		alias(this_recp);
+		alias(this_recp);
 		mailtype = alias(this_recp);
-		mailtype = alias(this_recp);
-		mailtype = alias(this_recp);
-		j = 0;
-		for (j=0; !IsEmptyStr(&this_recp[j]); ++j) {
+
+		for (j = 0; !IsEmptyStr(&this_recp[j]); ++j) {
 			if (this_recp[j]=='_') {
 				this_recp_cooked[j] = ' ';
 			}
@@ -4723,7 +4688,7 @@
 		cdb_free(cdbfr);
 	}
 	if (num_msgs > 0) {
-		int have_contenttype = !IsEmptyStr(content_type);
+		int have_contenttype = (content_type != NULL) && !IsEmptyStr(content_type);
 		int have_delmsgs = (num_dmsgnums == 0) || (dmsgnums == NULL);
 		int have_more_del = 1;
 
diff -Nru citadel-8.11/msgbase.h citadel-8.12/msgbase.h
--- citadel-8.11/msgbase.h	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/msgbase.h	2012-06-26 17:56:25.000000000 +0200
@@ -144,7 +144,6 @@
 void CtdlFreeMessage(struct CtdlMessage *msg);
 void CtdlFreeMessageContents(struct CtdlMessage *msg);
 void serialize_message(struct ser_ret *, struct CtdlMessage *);
-void dump_message(struct CtdlMessage *msg, long Siz);
 int is_valid_message(struct CtdlMessage *);
 void ReplicationChecks(struct CtdlMessage *);
 int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newmsgs,
diff -Nru citadel-8.11/po/citadel-setup/de.po citadel-8.12/po/citadel-setup/de.po
--- citadel-8.11/po/citadel-setup/de.po	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/po/citadel-setup/de.po	2012-06-26 17:56:25.000000000 +0200
@@ -111,6 +111,15 @@
 "listen on all addresses. This can usually be left to the default unless "
 "multiple instances of Citadel are running on the same computer."
 msgstr ""
+"Bitte geben Sie die IP-Adresse, die der Server sein sollte zuh�. Sie "
+"k�n den Namen einer bestimmten IPv4 oder IPv6-Adresse, oder Sie k�n "
+"festlegen,\n"
+"'*' F�ne beliebige Adresse', ':' f�le IPv6-Adresse \"oder '0 "
+".0.0.0'\n"
+"f�lle IPv4-Adresse\". Wenn Sie dieses Feld leer lassen, wird Citadel\n"
+"h� auf alle Adressen. Diese k�n in der Regel auf den Standardwert "
+"belassen werden, es sei denn mehrere Instanzen Zitadelle auf dem gleichen "
+"Computer ausgef�erden."
 
 #
 #: ../utils/setup.c:168
@@ -126,13 +135,18 @@
 "of Citadel on the same computer and there is something else\n"
 "already using port 504.\n"
 msgstr ""
+"Geben Sie den TCP-Port-Nummer auf dem Server ausgef�ird.\n"
+"Normalerweise wird dieser Port 504, die die offizielle Schnittstelle ist\n"
+"zugewiesen von der IANA f�adel-Servern. Sie m�nur\n"
+"Um einen anderen Port-Nummer, wenn Sie mehrere Instanzen laufen\n"
+"der Zitadelle auf dem gleichen Computer, und es ist etwas anderes\n"
+"bereits �ort 504 auf.\n"
 
 #: ../utils/setup.c:177
 msgid "Authentication method to use:"
 msgstr "Zu verwendene Authentifizierungsmethode:"
 
 #: ../utils/setup.c:179
-#, fuzzy
 msgid ""
 "Please choose the user authentication mode. By default Citadel will use its "
 "own internal user accounts database. If you choose Host, Citadel users will "
@@ -150,12 +164,20 @@
 "\n"
 "ANSWER \"0\" UNLESS YOU COMPLETELY UNDERSTAND THIS OPTION.\n"
 msgstr ""
-"Bitte w�en Sie die Authentifizierungsmethode f�utzer. Standardm�g "
-"wird Citadel seine interne Benutzerkontendatenbank verwenden. Falls Sie "
-"�Host� w�en, werden die Benutzer von Citadel Konten auf dem Gastsystem "
-"haben und via /etc/passwd oder einer PAM-Quelle authentifiziert werden. "
-"�LDAP� w�t einen RFC2307-konformen Verzeichnisdienst, die letzte Option "
-"w�t das nicht-standard �MS Active Directory� LDAP-Schema.\n"
+"Bitte w�en Sie die Benutzer-Authentifizierung-Modus. Standardm�g Citadel "
+"wird seine eigenen internen Benutzerkonten-Datenbank. Wenn Sie Host w�en, "
+"wird Citadel Benutzer haben Accounts auf dem Host-System, � etc / "
+"passwd oder eine PAM Quelle authentifiziert. LDAP w�t eine RFC 2307 "
+"kompatiblen Verzeichnisserver, w�t die letzte Option der Nicht-Standard-MS "
+"Active Directory LDAP Schema.\n"
+"�dern Sie diese Option, wenn Sie sicher, dass es erforderlich ist, sind "
+"seit dem Wechsel zur�fordert ein voller Citadel neu zu installieren.\n"
+"0. Eigenst�iges Authentifizierung\n"
+"1. Host-System integrierte Authentifizierung\n"
+"2. Externe LDAP - RFC 2307 konforme Verzeichnisdienste\n"
+"3. Externe LDAP - Nicht-Standard-MS Active Directory\n"
+"\n"
+"F�fe: http://www.citadel.org/doku.php/faq:installation:authmodes\n";
 
 #: ../utils/setup.c:197
 msgid "LDAP host:"
diff -Nru citadel-8.11/po/citadel-setup/es.po citadel-8.12/po/citadel-setup/es.po
--- citadel-8.11/po/citadel-setup/es.po	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/po/citadel-setup/es.po	2012-06-26 17:56:25.000000000 +0200
@@ -30,14 +30,14 @@
 "Project-Id-Version: citadel-7.66-1\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-09-28 00:22+0200\n"
-"PO-Revision-Date: 2011-09-01 21:50+0000\n"
-"Last-Translator: Alejandro Pérez <alexperezalonso@gmail.com>\n"
+"PO-Revision-Date: 2012-05-28 16:11+0000\n"
+"Last-Translator: Enrique D A <Unknown>\n"
 "Language-Team: Debian Spanish <debian-l10n-spanish@lists.debian.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-02 04:36+0000\n"
-"X-Generator: Launchpad (build 13830)\n"
+"X-Launchpad-Export-Date: 2012-05-29 04:33+0000\n"
+"X-Generator: Launchpad (build 15316)\n"
 "Language: es\n"
 
 #: ../utils/setup.c:119
@@ -51,9 +51,9 @@
 "specify a directory other than the default, you will need to\n"
 "specify the -h flag to the server when you start it up.\n"
 msgstr ""
-"Introduzca la ruta completa del directorio en el que \n"
+"Introduzca la ruta completa del directorio en el que\n"
 "se encuentra la instalación de Citadel. Si especifica\n"
-"un directorio diferente al por defecto, deberá\n"
+"un directorio diferente al predeterminado, deberá\n"
 "especificar la opción -h en el servidor cuando lo inicie.\n"
 
 #: ../utils/setup.c:128
@@ -64,6 +64,11 @@
 "specify the -h flag to the server when you start it up.\n"
 "note that it may not have a leading /"
 msgstr ""
+"Ingrese el nombre de subdirectorio para una instalación alternativa de "
+"Citadel. Para una instalación predeterminada solo dejelo vacío. Si "
+"especifica un directorio diferente al predeterminado,\n"
+"necesitará especificar la bandera -h al servidor cuando lo inicie.\n"
+"observe que el nombre no termina con /"
 
 #: ../utils/setup.c:135
 msgid "Citadel administrator username:"
@@ -108,6 +113,12 @@
 "user ID here.  You may specify either a user name or a numeric\n"
 "UID.\n"
 msgstr ""
+"Citadel necesita correr bajo su propio ID de usuario. Este puede\n"
+"llamarse \"citadel\", pero si está corriendo Citadel\n"
+"como un BBS público, podría llamarlo \"bbs\" o \"invitado\".\n"
+"El servidor correrá bajo este ID de usuario. Por favor indique el\n"
+"ID de usuario aquí. Puede especificar tanto un nombre de usuario o un \n"
+"UID númerico.\n"
 
 #: ../utils/setup.c:158
 msgid "Listening address for the Citadel server:"
@@ -122,6 +133,13 @@
 "listen on all addresses. This can usually be left to the default unless "
 "multiple instances of Citadel are running on the same computer."
 msgstr ""
+"Por favor especifique la dirección IP que el servidor deberá escuchar. Puede "
+"nombrar una dirección especifica IPv4 o IPv6, o puede\n"
+"especificar '*' para 'cualquier dirección', '::' para 'cualquier dirección "
+"IPv6' o '0.0.0.0'\n"
+"para 'cualquier dirección IPv4'. Si lo deja en blanco, Citadel escuchará\n"
+"en todas las direcciones. Puede dejar el valor predeterminado a menos que "
+"varias instancias de Citadel esten corriendo en la misma computadora."
 
 #: ../utils/setup.c:168
 msgid "Server port number:"
@@ -165,6 +183,18 @@
 "\n"
 "ANSWER \"0\" UNLESS YOU COMPLETELY UNDERSTAND THIS OPTION.\n"
 msgstr ""
+"Por favor seleccione el modo de autenticación del usuario. Citadel puede "
+"usar su propia base de datos de cuentas de usuario internas. Si elige "
+"anfitrión (Host), Los usuarios de Citadel deberán tener cuentas en el equipo "
+"anfitrión, autenticados por medio de /etc/passwd o una fuente PAM. LDAP "
+"selecciona un servidor de directorio que cumple con RFC 2307, la última "
+"opción elige el esquema no estándar de Directorio Activo de MS.\n"
+"No cambie esta opción a menos que este seguro que es requerida, ya que "
+"cambiarla de nuevo requiere una reinstalación completa de Citadel.\n"
+"0. Autenticación interna\n"
+"1. Autenticación integrada en el sistema anfitrión\n"
+"3. LDAP Externo - Directorio compatible RFC 2307\n"
+"3. LDAP Externo - Directorio Activo MS no estándar\n"
 
 #: ../utils/setup.c:197
 msgid "LDAP host:"
@@ -212,6 +242,10 @@
 "privileges.  If your LDAP server allows anonymous queries, you can\n"
 "leave this blank.\n"
 msgstr ""
+"Por favor introduzca el DN de una cuenta a usar para ligar al servidor LDAP\n"
+"para realizar consultas. La cuenta no requiere ningún otro\n"
+"privilegio. Si el servidor LDAP permite consultas anónimas, puede\n"
+"dejarlo en blanco.\n"
 
 #: ../utils/setup.c:220
 msgid "LDAP bind password:"
@@ -223,6 +257,9 @@
 "the password associated with that account.  Otherwise, you can leave this\n"
 "blank.\n"
 msgstr ""
+"Si introdujo un Bind DN en la pregunta anterior, ahora debe introducir\n"
+"la contraseña asociada con esa cuenta. Si no, puede dejar este\n"
+"en blanco.\n"
 
 #: ../utils/setup.c:299
 msgid "Yes/No"
@@ -250,7 +287,7 @@
 
 #: ../utils/setup.c:459
 msgid "Adding service entry..."
-msgstr ""
+msgstr "Adición de entrada de servicio"
 
 #. Other errors might mean something really did go wrong.
 #. 
@@ -263,6 +300,8 @@
 "Citadel already appears to be configured to start at boot.\n"
 "Would you like to keep your boot configuration as is?\n"
 msgstr ""
+"Citadel parece estar configurado para iniciarse en el arranque.\n"
+"¿Quiere mantener su configuración de arranque, como está?\n"
 
 #: ../utils/setup.c:577
 msgid "Would you like to automatically start Citadel at boot?\n"
@@ -279,10 +318,14 @@
 "connect incoming telnet sessions to Citadel, bypassing the\n"
 "host system login: prompt.  Would you like to do this?\n"
 msgstr ""
+"El programa de instalación puede configurar el servicio \"xinetd\" para "
+"automáticamente\n"
+"conectar las sesiones entrantes de telnet al Citadel, sin pasar por el\n"
+"inicio de sesión del sistema anfitrión. ¿Quiere hacer esto?\n"
 
 #: ../utils/setup.c:740
 msgid "You appear to have the "
-msgstr ""
+msgstr "Parece que tiene el "
 
 #: ../utils/setup.c:742
 msgid ""
@@ -290,12 +333,17 @@
 "running on your system.  If you want Citadel mail\n"
 "connected with "
 msgstr ""
+" programa de correo\n"
+"corriendo en su sistema. Si desea que Citadel mal\n"
+"se conecte con "
 
 #: ../utils/setup.c:746
 msgid ""
 " you will have to manually integrate\n"
 "them.  It is preferable to disable "
 msgstr ""
+" tendrá que integrarlos manualmente.\n"
+"Es preferible desactivarlo "
 
 #: ../utils/setup.c:749
 msgid ""
@@ -304,24 +352,29 @@
 "\n"
 "May we disable "
 msgstr ""
+", y usar los servicios de Citadel\n"
+"SMTP, POP3 e IMAP\n"
+"Podemos desactivarlos "
 
 #: ../utils/setup.c:753
 msgid ""
 "so that Citadel has access to ports\n"
 "25, 110, and 143?\n"
 msgstr ""
+"para que Citadel tenga acceso a los puertos\n"
+"25, 110 y 143?\n"
 
 #: ../utils/setup.c:863
 msgid "This is currently set to:"
-msgstr ""
+msgstr "Esto está actualmente establecido a:"
 
 #: ../utils/setup.c:864
 msgid "Enter new value or press return to leave unchanged:"
-msgstr ""
+msgstr "Entre un nuevo valor o presione retorno para dejarlo sin cambio:"
 
 #: ../utils/setup.c:1067 ../utils/setup.c:1072 ../utils/setup.c:1384
 msgid "setup: cannot open"
-msgstr ""
+msgstr "instalación: no puede abrir"
 
 #: ../utils/setup.c:1175
 #, c-format
@@ -335,10 +388,18 @@
 "Do you want this module to be automatically disabled?\n"
 "\n"
 msgstr ""
+"\n"
+"/etc/nsswitch.conf está configurador para usar el modulo 'db' para\n"
+"uno o más servicios. Esto no es necesario en la mayoría de los sistemas,\n"
+"y se sabe que bloquea el servidor Citadel al entregar el correo\n"
+"a Internet.\n"
+"\n"
+"¿Quieres que este módulo se desactive automáticamente?\n"
+"\n"
 
 #: ../utils/setup.c:1236 ../utils/setup.c:1252
 msgid "Setup finished"
-msgstr ""
+msgstr "Configuración terminada"
 
 #: ../utils/setup.c:1237
 msgid ""
@@ -347,20 +408,26 @@
 "setup program now; otherwise, run './citadel'\n"
 "to log in.\n"
 msgstr ""
+"La configuración del servidor Citadel está completa.\n"
+"Si usará Webcit, por favor ejecute su\n"
+"programa de configuración ahora, de lo contrario, corra './citadel'\n"
+"para  entrar.\n"
 
 #: ../utils/setup.c:1243
 msgid "Setup failed"
-msgstr ""
+msgstr "La configuración fallo."
 
 #: ../utils/setup.c:1244
 msgid ""
 "Setup is finished, but the Citadel server failed to start.\n"
 "Go back and check your configuration.\n"
 msgstr ""
+"La configuración ha concluido, pero el servidor Citadel fallo al iniciar.\n"
+"Regrese y revise su configuración.\n"
 
 #: ../utils/setup.c:1253
 msgid "Setup is finished.  You may now start the server."
-msgstr ""
+msgstr "La configuración ha terminado. Ahora puede iniciar el servidor."
 
 #: ../utils/setup.c:1279
 msgid "My System"
@@ -372,12 +439,12 @@
 
 #: ../utils/setup.c:1368 ../utils/setup.c:1373
 msgid "setup: cannot append"
-msgstr ""
+msgstr "configuración: no puede anexar"
 
 #: ../utils/setup.c:1450 ../utils/setup.c:1457 ../utils/setup.c:1472
 #: ../utils/setup.c:1512
 msgid "Citadel Setup"
-msgstr ""
+msgstr "Instalar Citadel"
 
 #: ../utils/setup.c:1459
 msgid "The directory you specified does not exist"
@@ -388,10 +455,12 @@
 "The Citadel service is still running.\n"
 "Please stop the service manually and run setup again."
 msgstr ""
+"El servicio Citadel aún está corriendo.\n"
+"Por favor detenga el servicio manualmente y corra la configuración otra vez."
 
 #: ../utils/setup.c:1485
 msgid "Citadel setup program"
-msgstr ""
+msgstr "Programa de configuración de Citadel"
 
 #: ../utils/setup.c:1513
 msgid "This Citadel installation is too old to be upgraded."
@@ -399,7 +468,7 @@
 
 #: ../utils/setup.c:1552 ../utils/setup.c:1554 ../utils/setup.c:1556
 msgid "Setting file permissions"
-msgstr ""
+msgstr "Configurar permisos de archivo"
 
 #~ msgid ""
 #~ "Please specify the IP address which the server should be listening to. If "
diff -Nru citadel-8.11/po/citadel-setup/fr.po citadel-8.12/po/citadel-setup/fr.po
--- citadel-8.11/po/citadel-setup/fr.po	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/po/citadel-setup/fr.po	2012-06-26 17:56:25.000000000 +0200
@@ -5,14 +5,14 @@
 # Translators:
 # Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>, 2008.
 # Christian Perrier <bubulle@debian.org>, 2008, 2009.
+# Nicolas Delvaux <Unknown>
 msgid ""
 msgstr ""
 "Project-Id-Version: fr-new\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-09-28 00:22+0200\n"
-"PO-Revision-Date: 2010-10-22 14:37+0000\n"
-"Last-Translator: Christian Perrier <bubulle@debian.org>\n"
-"Last-Translator: Nicolas Delvaux <Unknown>\n"
+"PO-Revision-Date: 2012-04-29 19:54+0100\n"
+"Last-Translator: François LANKAR <lankarf@gmail.com>\n"
 "Language-Team: French <debian-l10n-french@lists.debian.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -34,7 +34,7 @@
 msgstr ""
 "Entrez le chemin complet du répertoire dans lequel se trouve\n"
 "l'installation de Citadel que vous créez ou mettez à jour. Si vous\n"
-"spécifiez un répertoire autre que celui par défaut, vous devrez\n"
+"spécifiez un répertoire différent de celui par défaut, vous devrez\n"
 "indiquer le paramètre -f au serveur lorsque vous le démarrerez.\n"
 
 #: ../utils/setup.c:128
@@ -45,14 +45,16 @@
 "specify the -h flag to the server when you start it up.\n"
 "note that it may not have a leading /"
 msgstr ""
-"Entrez le chemin complet du répertoire dans lequel se trouve\n"
-"l'installation de Citadel que vous créez ou mettez à jour. Si vous\n"
-"spécifiez un répertoire autre que celui par défaut, vous devrez\n"
-"indiquer le paramètre -f au serveur lorsque vous le démarrerez."
+"Entrez le nom du sous-répertoire pour une installation alternative de "
+"Citadel. Si vous souhaitez faire une installation par défaut, laissez le "
+"champ vide. Si vous indiquez un répertoire différent de celui par défaut, vous "
+"devrez\n"
+"indiquer le paramètre -h au serveur lorsque vous le démarrerez.\n"
+"Veuillez noter qu'il ne devrait pas commencer par un /"
 
 #: ../utils/setup.c:135
 msgid "Citadel administrator username:"
-msgstr "Identifiant de l'administrateur de Citadel:"
+msgstr "Identifiant de l'administrateur de Citadel :"
 
 #: ../utils/setup.c:137
 msgid ""
@@ -63,12 +65,12 @@
 msgstr ""
 "Veuillez indiquer l'identifiant Citadel qui disposera des privilèges "
 "d'administration après création. Si le système interne d'authentification "
-"est utilisé, ce compte sera créé. Si un système externe d'authentification "
+"est utilisé, ce compte sera créé s'il n'existe déjà. Si un système externe d'authentification "
 "est utilisé, ce compte doit déjà y exister."
 
 #: ../utils/setup.c:143
 msgid "Administrator password:"
-msgstr "Mot de passe de l'administrateur:"
+msgstr "Mot de passe de l'administrateur :"
 
 #: ../utils/setup.c:145
 msgid ""
@@ -76,6 +78,9 @@
 "completes it will attempt to create the administrator user\n"
 "and set the password specified here.\n"
 msgstr ""
+"Entrez un mot de passe pour l'administrateur système. À la fin de \n"
+"l'installation, le programme tentera de créer le super-utilisateur \n"
+"et utiliser le mot de passe indiqué ici. \n"
 
 #: ../utils/setup.c:149
 msgid "Citadel User ID:"
@@ -90,6 +95,14 @@
 "user ID here.  You may specify either a user name or a numeric\n"
 "UID.\n"
 msgstr ""
+"Citadel a besoin de fonctionner avec son propre ID d'utilisateur. Celui-ci \n"
+"est généralement appelé \"citadel\", mais si vous exécutez Citadel \n"
+"comme un BBS public, vous pouvez également l'appeler \"bbs\" ou \"guest\".\n"
+"Le serveur fonctionnera sous cet ID utilisateur. Vous êtes prié de préciser "
+"un\n"
+"ID utilisateur ici. Vous pouvez spécifier soit un nom d'utilisateur soit un "
+"UID \n"
+"numérique. \n"
 
 #: ../utils/setup.c:158
 msgid "Listening address for the Citadel server:"
@@ -104,10 +117,18 @@
 "listen on all addresses. This can usually be left to the default unless "
 "multiple instances of Citadel are running on the same computer."
 msgstr ""
+"Veuillez indiquer l'adresse IP que le serveur IP doit écouter. Vous pouvez "
+"mettre une adresse spécifique IPv4 ou IPv6, ou vous pouvez spécifier \n"
+"« * » pour « n'importe quelle adresse », « :: » pour « toutes les adresses IPv6 », "
+"ou « 0.0.0.0 » \n"
+"pour « toutes les adresses IPv4 ». Si vous laissez ce champ vide, Citadel \n"
+"écoutera sur toutes les adresses. Ce champ peut généralement être laissé à "
+"la valeur par défaut sauf si plusieurs instances de Citadel sont en cours "
+"d'exécution sur le même ordinateur."
 
 #: ../utils/setup.c:168
 msgid "Server port number:"
-msgstr "Numéro de port du Serveur :"
+msgstr "Numéro de port du serveur :"
 
 #: ../utils/setup.c:170
 msgid ""
@@ -118,6 +139,12 @@
 "of Citadel on the same computer and there is something else\n"
 "already using port 504.\n"
 msgstr ""
+"Indiquez le numéro de port TCP sur lequel votre serveur sera exécuté. \n"
+"Normalement, ce sera le port 504, qui est le port officiel \n"
+"attribué par l'IANA pour les serveurs Citadel. Vous aurez besoin de\n"
+"spécifier un numéro de port différent si vous exécutez plusieurs instances \n"
+"de Citadel sur le même ordinateur ou si quelque chose d'autre\n"
+"utilise déjà le port 504. \n"
 
 #: ../utils/setup.c:177
 msgid "Authentication method to use:"
@@ -141,6 +168,23 @@
 "\n"
 "ANSWER \"0\" UNLESS YOU COMPLETELY UNDERSTAND THIS OPTION.\n"
 msgstr ""
+"Veuillez choisir le mode d'authentification de l'utilisateur. Citadel "
+"utilisera par défaut sa propre base de données d'utilisateurs. Si "
+"vous choisissez Host, les utilisateurs de Citadel auront des comptes sur le "
+"système hôte, authentifiés par le fichier /etc/passwd ou une source PAM. "
+"LDAP choisit un serveur d'annuaire respectant la RFC 2307, la dernière "
+"option choisit la version non standard de LDAP MS Active Directory. \n"
+"Ne modifiez pas cette option à moins que d'être sûr que cela soit "
+"nécessaire, car revenir en arrière nécessite une réinstallation complète de "
+"Citadel. \n"
+"    0. Authentification automatique \n"
+"    1. Authentification intégrée au système hôte \n"
+"    2. LDAP externe — répertoire conforme à la RFC 2307 \n"
+"    3. LDAP externe – non standard MS Active Directory \n"
+"\n"
+"Pour de l'aide : http://www.citadel.org/doku.php/faq:installation:authmodes\n";
+"\n"
+"Répondez « 0 » sauf si vous comprenez complètement cette option.\n"
 
 #: ../utils/setup.c:197
 msgid "LDAP host:"
@@ -162,7 +206,7 @@
 
 #: ../utils/setup.c:205
 msgid "LDAP base DN:"
-msgstr "DN de base du serveur LDAP:"
+msgstr "DN de base du serveur LDAP :"
 
 #: ../utils/setup.c:207
 msgid ""
@@ -174,7 +218,7 @@
 
 #: ../utils/setup.c:210
 msgid "LDAP bind DN:"
-msgstr "Compte de connexion LDAP:"
+msgstr "Compte de connexion LDAP :"
 
 #: ../utils/setup.c:212
 msgid ""
@@ -186,10 +230,14 @@
 "privileges.  If your LDAP server allows anonymous queries, you can\n"
 "leave this blank.\n"
 msgstr ""
+"Veuillez entrer l'identifiant unique d'un compte à utiliser pour la liaison avec le serveur "
+"LDAP pour l'exécution des requêtes. Le compte ne nécessite pas d'autres "
+"privilèges. Si votre serveur LDAP autorise les requêtes anonymes, vous "
+"pouvez laisser ce champ vide.\n"
 
 #: ../utils/setup.c:220
 msgid "LDAP bind password:"
-msgstr "Mot de passe de connexion LDAP:"
+msgstr "Mot de passe de connexion LDAP :"
 
 #: ../utils/setup.c:222
 msgid ""
@@ -197,6 +245,10 @@
 "the password associated with that account.  Otherwise, you can leave this\n"
 "blank.\n"
 msgstr ""
+"Si vous avez entré un identifiant Bind à la question précédente, vous devez "
+"maintenant entrer \n"
+"le mot de passe associé à ce compte. Sinon, vous pouvez laisser ce \n"
+"champ vide. \n"
 
 #: ../utils/setup.c:299
 msgid "Yes/No"
@@ -212,7 +264,7 @@
 
 #: ../utils/setup.c:346
 msgid "Press return to continue..."
-msgstr "Appuyer sur entrée pour continuer..."
+msgstr "Appuyer sur entrée pour continuer…"
 
 #: ../utils/setup.c:364
 msgid "Important Message"
@@ -227,7 +279,7 @@
 msgstr "Ajouter un service"
 
 #. Other errors might mean something really did go wrong.
-#. 
+#.
 #: ../utils/setup.c:463 ../utils/setup.c:510 ../utils/setup.c:518
 msgid "Cannot open"
 msgstr "Ne peut être ouvert"
@@ -237,12 +289,12 @@
 "Citadel already appears to be configured to start at boot.\n"
 "Would you like to keep your boot configuration as is?\n"
 msgstr ""
-"Citadel est déjà configuré pour se lancer au démarage.\n"
-"Voulez-vous garder cette configuration de démarage ?\n"
+"Citadel est déjà configuré pour se lancer au démarrage.\n"
+"Voulez-vous garder cette configuration de démarrage ?\n"
 
 #: ../utils/setup.c:577
 msgid "Would you like to automatically start Citadel at boot?\n"
-msgstr "Voulez-vous lancer Citadel au démarage ?\n"
+msgstr "Voulez-vous lancer Citadel au démarrage ?\n"
 
 #: ../utils/setup.c:583
 msgid "Cannot create"
@@ -255,10 +307,14 @@
 "connect incoming telnet sessions to Citadel, bypassing the\n"
 "host system login: prompt.  Would you like to do this?\n"
 msgstr ""
+"Le programme d'installation peut configurer le service \"xinetd\" pour se "
+"connecter\n"
+"automatiquement à des sessions telnet entrantes vers Citadel, outrepassant l'invite \n"
+"de connexion au système hôte. Voulez-vous faire cela ? \n"
 
 #: ../utils/setup.c:740
 msgid "You appear to have the "
-msgstr ""
+msgstr "Vous semblez avoir le"
 
 #: ../utils/setup.c:742
 msgid ""
@@ -266,12 +322,18 @@
 "running on your system.  If you want Citadel mail\n"
 "connected with "
 msgstr ""
+"programme de messagerie \n"
+"en cours d'exécution sur votre système. Si vous voulez que la messagerie de "
+"Citadel y soit \n"
+"connecté "
 
 #: ../utils/setup.c:746
 msgid ""
 " you will have to manually integrate\n"
 "them.  It is preferable to disable "
 msgstr ""
+"vous allez devoir l'intégrer manuellement. \n"
+"Il est préférable de le désactiver"
 
 #: ../utils/setup.c:749
 msgid ""
@@ -280,26 +342,32 @@
 "\n"
 "May we disable "
 msgstr ""
+", et utiliser \n"
+"les services SMTP, POP3, IMAP de Citadel . \n"
+"\n"
+"Pouvons-nous désactiver "
 
 #: ../utils/setup.c:753
 msgid ""
 "so that Citadel has access to ports\n"
 "25, 110, and 143?\n"
 msgstr ""
+"de telle sorte que Citadel ait accès aux ports \n"
+"25, 110 et 143 ? \n"
 
 #: ../utils/setup.c:863
 msgid "This is currently set to:"
-msgstr ""
+msgstr "Ceci est actuellement fixé à :"
 
 #: ../utils/setup.c:864
 msgid "Enter new value or press return to leave unchanged:"
 msgstr ""
-"Entrez une nouvelle valeur ou appuyer dur entrée pour laisser la valeur "
-"actuel :"
+"Entrez une nouvelle valeur ou appuyez sur entrée pour laisser la valeur "
+"actuelle :"
 
 #: ../utils/setup.c:1067 ../utils/setup.c:1072 ../utils/setup.c:1384
 msgid "setup: cannot open"
-msgstr "setup: ne peut être ouvert"
+msgstr "setup : ne peut être ouvert"
 
 #: ../utils/setup.c:1175
 #, c-format
@@ -313,10 +381,19 @@
 "Do you want this module to be automatically disabled?\n"
 "\n"
 msgstr ""
+"\n"
+"/etc/nsswitch.conf est configuré pour utiliser le module « db » pour \n"
+"un ou plusieurs services. Ce n'est pas nécessaire sur la plupart des "
+"systèmes, \n"
+"et il est connu pour faire planter le serveur Citadel lorsqu'il envoie \n"
+"un courrier sur Internet. \n"
+"\n"
+"Voulez-vous que ce module soit désactivé automatiquement ? \n"
+"\n"
 
 #: ../utils/setup.c:1236 ../utils/setup.c:1252
 msgid "Setup finished"
-msgstr "Installation terminé"
+msgstr "Installation terminée"
 
 #: ../utils/setup.c:1237
 msgid ""
@@ -325,31 +402,30 @@
 "setup program now; otherwise, run './citadel'\n"
 "to log in.\n"
 msgstr ""
-"L'installation du serveur Citadel est terminé.\n"
-"Si vous voulez utiliser WebCit, lancez s'il\n"
-"vous plait le programme d'installation maintenant;\n"
-"sinon lancer './citadel' pour vous identifier.\n"
+"L'installation du serveur Citadel est terminée.\n"
+"Si vous voulez utiliser WebCit, veuillez lancer\n"
+"maintenant son programme d'installation ;\n"
+"sinon, lancez « ./citadel » pour vous identifier.\n"
 
 #: ../utils/setup.c:1243
 msgid "Setup failed"
-msgstr "Installation échoué"
+msgstr "Installation échouée"
 
 #: ../utils/setup.c:1244
 msgid ""
 "Setup is finished, but the Citadel server failed to start.\n"
 "Go back and check your configuration.\n"
 msgstr ""
-"L'installation est terminé mais le serveur Citadel n'a pu être lancé.\n"
+"L'installation est terminée mais le serveur Citadel n'a pu être lancé.\n"
 "Retournez en arrière pour vérifier votre configuration.\n"
 
 #: ../utils/setup.c:1253
 msgid "Setup is finished.  You may now start the server."
-msgstr ""
-"L'installation est terminé. Vous pouvez maintenant lancer le serveur."
+msgstr "L'installation est terminée. Vous pouvez maintenant lancer le serveur."
 
 #: ../utils/setup.c:1279
 msgid "My System"
-msgstr "Mon Systeme"
+msgstr "Mon Système"
 
 #: ../utils/setup.c:1282
 msgid "US 800 555 1212"
@@ -357,7 +433,7 @@
 
 #: ../utils/setup.c:1368 ../utils/setup.c:1373
 msgid "setup: cannot append"
-msgstr ""
+msgstr "Programme d'installation : ne peut pas ajouter"
 
 #: ../utils/setup.c:1450 ../utils/setup.c:1457 ../utils/setup.c:1472
 #: ../utils/setup.c:1512
@@ -366,39 +442,42 @@
 
 #: ../utils/setup.c:1459
 msgid "The directory you specified does not exist"
-msgstr "Le répertoire spécifié n'existe pas."
+msgstr "Le répertoire indiqué n'existe pas."
 
 #: ../utils/setup.c:1473
 msgid ""
 "The Citadel service is still running.\n"
 "Please stop the service manually and run setup again."
 msgstr ""
+"Le service Citadel est en cours d'exécution. \n"
+"Veuillez arrêter vous-même le service et relancer l'installation."
 
 #: ../utils/setup.c:1485
 msgid "Citadel setup program"
-msgstr ""
+msgstr "Programme d'installation de Citadel"
 
 #: ../utils/setup.c:1513
 msgid "This Citadel installation is too old to be upgraded."
 msgstr ""
+"Cette installation de Citadel est trop vieille pour être mise à niveau."
 
 #: ../utils/setup.c:1552 ../utils/setup.c:1554 ../utils/setup.c:1556
 msgid "Setting file permissions"
-msgstr ""
+msgstr "Définition des permissions sur les fichiers"
 
 #~ msgid ""
 #~ "Please specify the IP address which the server should be listening to. If "
 #~ "you specify 0.0.0.0, the server will listen on all addresses."
 #~ msgstr ""
-#~ "Veuillez indiquer l'adresse IP sur laquelle le serveur sera actif. Si vous "
-#~ "indiquez 0.0.0.0, Citadel sera à l'écoute de toutes les adresses."
+#~ "Veuillez indiquer l'adresse IP sur laquelle le serveur sera actif. Si "
+#~ "vous indiquez 0.0.0.0, Citadel sera à l'écoute de toutes les adresses."
 
 #~ msgid ""
-#~ "This can usually be left to the default unless multiple instances of Citadel "
-#~ "are running on the same computer."
+#~ "This can usually be left to the default unless multiple instances of "
+#~ "Citadel are running on the same computer."
 #~ msgstr ""
-#~ "Vous pouvez normalement sauter cette étape à moins que plusieurs instances "
-#~ "de Citadel ne tournent sur le même ordinateur."
+#~ "Vous pouvez normalement sauter cette étape à moins que plusieurs "
+#~ "instances de Citadel ne tournent sur le même ordinateur."
 
 #~ msgid "Internal"
 #~ msgstr "Interne"
@@ -410,8 +489,8 @@
 #~ msgstr "LDAP"
 
 #~ msgid ""
-#~ "Do not change this option unless you are sure it is required, since changing "
-#~ "back requires a full reinstall of Citadel."
+#~ "Do not change this option unless you are sure it is required, since "
+#~ "changing back requires a full reinstall of Citadel."
 #~ msgstr ""
 #~ "Ne modifiez cette option que si elle est indispensable car il n'est pas "
 #~ "possible de la changer sans entièrement réinstaller Citadel."
diff -Nru citadel-8.11/po/citadel-setup/ru.po citadel-8.12/po/citadel-setup/ru.po
--- citadel-8.11/po/citadel-setup/ru.po	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/po/citadel-setup/ru.po	2012-06-26 17:56:25.000000000 +0200
@@ -10,21 +10,21 @@
 "Project-Id-Version: citadel 7.63-1\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2010-09-28 00:22+0200\n"
-"PO-Revision-Date: 2010-12-14 08:13+0000\n"
-"Last-Translator: Andrey Olykainen <Unknown>\n"
+"PO-Revision-Date: 2012-01-01 22:15+0000\n"
+"Last-Translator: Alexander Vrublevskiy <Unknown>\n"
 "Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-12-15 04:32+0000\n"
-"X-Generator: Launchpad (build Unknown)\n"
+"X-Launchpad-Export-Date: 2012-01-02 04:55+0000\n"
+"X-Generator: Launchpad (build 14560)\n"
 "Language: ru\n"
 "Plural-Forms:  nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
 
 #: ../utils/setup.c:119
 msgid "Citadel Home Directory"
-msgstr "Домашняя директория Citadel"
+msgstr "Директория Citadel"
 
 #: ../utils/setup.c:122
 msgid ""
@@ -33,6 +33,9 @@
 "specify a directory other than the default, you will need to\n"
 "specify the -h flag to the server when you start it up.\n"
 msgstr ""
+"Введите полный путь к  директории установки/обновления Citadel.\n"
+"Если путь отличается от пути по умолчанию, не забудьте указать\n"
+"его в значении параметра -h при  запуске citserver\n"
 
 #: ../utils/setup.c:128
 msgid ""
@@ -42,10 +45,15 @@
 "specify the -h flag to the server when you start it up.\n"
 "note that it may not have a leading /"
 msgstr ""
+"Для установки в директорию по умолчанию оставьте это поле пустым.\n"
+"Если вам необходимо установить Citadel в какое-либо другое место,\n"
+"введите здесь полный путь к нужной директории (без / в начале!).\n"
+"Имейте в виду, что это значение нужно будет передать с параметром -h при "
+"запуске citserver"
 
 #: ../utils/setup.c:135
 msgid "Citadel administrator username:"
-msgstr "Имя учётной записи администратора Citadel:"
+msgstr "Администратор Citadel"
 
 #: ../utils/setup.c:137
 msgid ""
@@ -54,25 +62,25 @@
 "this user account will be created if it does not exist. For external "
 "authentication this user account has to exist."
 msgstr ""
-"Введите название учётной записи пользователя Citadel, которой будут даны "
-"административные права после создания. Если используется внутренняя "
-"аутентификация, то данная учётная запись будет создана в случае её "
-"отсутствия. При внешней аутентификации пользователь должен существовать."
+"Введите имя учетной записи администратора Citadel.\r\n"
+"Если используется внешняя аутентификация, запись должна существовать.\r\n"
+"Если внешняя аутентификация происходит через LDAP/AD,\r\n"
+"в качестве имени администратора укажите Display Name нужной записи"
 
 #: ../utils/setup.c:143
 msgid "Administrator password:"
-msgstr "Пароль к учётной записи администратора:"
+msgstr "Пароль администратора"
 
 #: ../utils/setup.c:145
 msgid ""
 "Enter a password for the system administrator. When setup\n"
 "completes it will attempt to create the administrator user\n"
 "and set the password specified here.\n"
-msgstr ""
+msgstr "Введите пароль администратора\n"
 
 #: ../utils/setup.c:149
 msgid "Citadel User ID:"
-msgstr "ID пользователя Citadel:"
+msgstr "ID пользователя Citadel"
 
 #: ../utils/setup.c:151
 msgid ""
@@ -83,10 +91,14 @@
 "user ID here.  You may specify either a user name or a numeric\n"
 "UID.\n"
 msgstr ""
+"По умолчанию программа setup автоматически создает пользователя,\n"
+"от имени которого будет работать сервер - citadel.\n"
+"Если это вам не подходит, вы можете указать в этом поле имя или ID другого "
+"пользователя\n"
 
 #: ../utils/setup.c:158
 msgid "Listening address for the Citadel server:"
-msgstr "Прослушиваемый адрес для сервера Citadel:"
+msgstr "IP адрес на котором Citadel ожидает запросы"
 
 #: ../utils/setup.c:160
 msgid ""
@@ -97,10 +109,14 @@
 "listen on all addresses. This can usually be left to the default unless "
 "multiple instances of Citadel are running on the same computer."
 msgstr ""
+"По умолчанию сервер Citadel ожидает запросы на всех IP адресах системы.\n"
+"Обычно этого достаточно, если только вы не планируете запускать\n"
+"несколько экземпляров Citadel. Тем не менее, здесь вы можете указать\n"
+"конкретный адрес IPv4 или IPv6, на котором Citadel будет ожидать запросы"
 
 #: ../utils/setup.c:168
 msgid "Server port number:"
-msgstr "Номер порта сервера:"
+msgstr "Номер порта"
 
 #: ../utils/setup.c:170
 msgid ""
@@ -111,10 +127,13 @@
 "of Citadel on the same computer and there is something else\n"
 "already using port 504.\n"
 msgstr ""
+"По умолчанию Citadel работает на порту 504/tcp, который официально\n"
+"зарегистрирован в IANA. Однако, если вы хотите запустить несколько\n"
+"экземпляров Citadel на одной машине, укажите здесь какое-либо иное значение\n"
 
 #: ../utils/setup.c:177
 msgid "Authentication method to use:"
-msgstr "Используемый метод аутентификации:"
+msgstr "Способ аутентификации"
 
 #: ../utils/setup.c:179
 msgid ""
@@ -134,38 +153,57 @@
 "\n"
 "ANSWER \"0\" UNLESS YOU COMPLETELY UNDERSTAND THIS OPTION.\n"
 msgstr ""
+"Укажите способ аутентификации пользователей.\n"
+"По умолчанию Citadel использует собственный механизм аутентификации.\n"
+"Однако, есть варианты системной аутентификацией (через /etc/passwd или любой "
+"модуль PAM),\n"
+"а также аутентификации через LDAP (RFC2307) и Active Directory (выбирайте "
+"этот вариант,\n"
+"если у вас AD).  Имейте в виду, что метод аутентификации в дальнейшем "
+"невозможно\n"
+"будет изменить без потери доступа для всех существующих пользователей!\n"
+"\n"
+"0) внутренняя аутентификация (по умолчанию)\n"
+"1) системная аутентификация (/etc/passwd)\n"
+"2) внешняя аутентификация - LDAP RFC2307\n"
+"3) внешняя аутентификация - M$ Active Directory\n"
+"\n"
+"Подробнее: http://www.citadel.org/doku.php/faq:installation:authmodes\n";
+"\n"
+"ВНИМАНИЕ!!! Если не уверены в своих действиях, выбирайте вариант \"0\"!\n"
 
 #: ../utils/setup.c:197
 msgid "LDAP host:"
-msgstr "Сервер LDAP:"
+msgstr "Сервер LDAP"
 
 #: ../utils/setup.c:199
 msgid "Please enter the host name or IP address of your LDAP server.\n"
-msgstr "Введите имя или IP-адрес сервера LDAP.\n"
+msgstr "Введите адрес сервера LDAP\n"
 
 #: ../utils/setup.c:201
 msgid "LDAP port number:"
-msgstr "Номер порта LDAP:"
+msgstr "Порт LDAP"
 
 #: ../utils/setup.c:203
 msgid "Please enter the port number of the LDAP service (usually 389).\n"
-msgstr "Введите номер порта службы LDAP (обычно 389).\n"
+msgstr "Введите номер порта LDAP (обычно 389)\n"
 
 #: ../utils/setup.c:205
 msgid "LDAP base DN:"
-msgstr "Базовое DN LDAP:"
+msgstr "Поиск в LDAP"
 
 #: ../utils/setup.c:207
 msgid ""
 "Please enter the Base DN to search for authentication\n"
 "(for example: dc=example,dc=com)\n"
 msgstr ""
-"Введите базовое DN для поиска, используемое при аутентификации \n"
-"(например: dc=example,dc=com).\n"
+"Введите distinguished name отправной точки для поиска учетных записей в "
+"LDAP\n"
+"(например, CN=Users,DC=domain,DC=local)\n"
 
 #: ../utils/setup.c:210
 msgid "LDAP bind DN:"
-msgstr "DN для подключения к серверу LDAP:"
+msgstr "Пользователь LDAP"
 
 #: ../utils/setup.c:212
 msgid ""
@@ -177,10 +215,19 @@
 "privileges.  If your LDAP server allows anonymous queries, you can\n"
 "leave this blank.\n"
 msgstr ""
+"Если ваш сервер LDAP позволяет выполнение анонимных запросов, можете "
+"оставить это поле пустым.\n"
+"В противном случае, введите здесь distinguished name учетной записи LDAP,\n"
+"у которой есть права на запрос информации,\n"
+"например CN=User,OU=Office,DC=domain,DC=local.\n"
+"\n"
+"ВАЖНО! Для данной записи не нужно никаких особенных прав,\n"
+"например, в случае аутентификации в AD, лучше ограничить права  этой записи "
+"только членством в группе Domain Guests\n"
 
 #: ../utils/setup.c:220
 msgid "LDAP bind password:"
-msgstr "Пароль для подключения к LDAP:"
+msgstr "Пароль LDAP"
 
 #: ../utils/setup.c:222
 msgid ""
@@ -188,8 +235,10 @@
 "the password associated with that account.  Otherwise, you can leave this\n"
 "blank.\n"
 msgstr ""
-"Если вы ввели DN учётной записи в предыдущем вопросе, то теперь вам нужно\n"
-"указать пароль для этой учётной записи. Иначе можете оставить поле пустым.\n"
+"Если ваш сервер LDAP позволяет выполнение анонимных запросов, можете "
+"оставить это поле пустым.\n"
+"В противном случае, введите здесь пароль учетной записи пользователя LDAP из "
+"предыдущего пункта\n"
 
 #: ../utils/setup.c:299
 msgid "Yes/No"
@@ -205,7 +254,7 @@
 
 #: ../utils/setup.c:346
 msgid "Press return to continue..."
-msgstr "Нажмите return для продолжения..."
+msgstr "Нажмите Enter чтобы продолжить..."
 
 #: ../utils/setup.c:364
 msgid "Important Message"
@@ -217,23 +266,26 @@
 
 #: ../utils/setup.c:459
 msgid "Adding service entry..."
-msgstr ""
+msgstr "Добавляется служебная запись..."
 
 #. Other errors might mean something really did go wrong.
 #. 
 #: ../utils/setup.c:463 ../utils/setup.c:510 ../utils/setup.c:518
 msgid "Cannot open"
-msgstr "Ошибка открытия"
+msgstr "Невозможно открыть"
 
 #: ../utils/setup.c:569
 msgid ""
 "Citadel already appears to be configured to start at boot.\n"
 "Would you like to keep your boot configuration as is?\n"
 msgstr ""
+"Похоже, что система сконфигурирована автоматически запускать Citadel при "
+"старте.\n"
+"Это то, что вам нужно (обычно да)?\n"
 
 #: ../utils/setup.c:577
 msgid "Would you like to automatically start Citadel at boot?\n"
-msgstr "Запускать автоматически Citadel при загрузке системы?\n"
+msgstr "Запускать Citadel автоматически при старте системы?\n"
 
 #: ../utils/setup.c:583
 msgid "Cannot create"
@@ -246,10 +298,13 @@
 "connect incoming telnet sessions to Citadel, bypassing the\n"
 "host system login: prompt.  Would you like to do this?\n"
 msgstr ""
+"Программа setup может попытаться автоматически настроить xinetd,\n"
+"чтобы при подключении по telnet к серверу Citadel пользователи\n"
+"миновали приглашение зарегистрироваться в системе. Настроить?\n"
 
 #: ../utils/setup.c:740
 msgid "You appear to have the "
-msgstr ""
+msgstr "Похоже, у вас уже установлена "
 
 #: ../utils/setup.c:742
 msgid ""
@@ -257,12 +312,16 @@
 "running on your system.  If you want Citadel mail\n"
 "connected with "
 msgstr ""
+" своя почтовая система. Если вы хотите,\n"
+"чтобы Citadel работала совместно с ней, "
 
 #: ../utils/setup.c:746
 msgid ""
 " you will have to manually integrate\n"
 "them.  It is preferable to disable "
 msgstr ""
+" вам придется совмещать их работу самостоятельно.\n"
+"Рекомендуется отключить "
 
 #: ../utils/setup.c:749
 msgid ""
@@ -271,25 +330,30 @@
 "\n"
 "May we disable "
 msgstr ""
+"существующую систему и использовать службы\n"
+"SMTP, POP3 и IMAP4, предоставляемые Citadel.\n"
+"Позволить программе setup отключить вашу почтовую систему "
 
 #: ../utils/setup.c:753
 msgid ""
 "so that Citadel has access to ports\n"
 "25, 110, and 143?\n"
 msgstr ""
+"таки образом, чтобы Citadel заняла порты\n"
+"25, 110 и 143?\n"
 
 #: ../utils/setup.c:863
 msgid "This is currently set to:"
-msgstr ""
+msgstr "Текущие настройки"
 
 #: ../utils/setup.c:864
 msgid "Enter new value or press return to leave unchanged:"
 msgstr ""
-"Введите новое значение или нажмите назад чтобы оставить без изменений:"
+"Введите новое значение или нажмите Enter, чтобы оставить без изменений"
 
 #: ../utils/setup.c:1067 ../utils/setup.c:1072 ../utils/setup.c:1384
 msgid "setup: cannot open"
-msgstr ""
+msgstr "Программа setup: ошибка при открытии"
 
 #: ../utils/setup.c:1175
 #, c-format
@@ -303,10 +367,15 @@
 "Do you want this module to be automatically disabled?\n"
 "\n"
 msgstr ""
+"\n"
+"Устаревшая настройка /etc/nsswitch.conf (модуль 'db')\n"
+"может помешать работе Citadel.\n"
+"В большинстве случаев она не нужна. Попробовать отключить ее?\n"
+"\n"
 
 #: ../utils/setup.c:1236 ../utils/setup.c:1252
 msgid "Setup finished"
-msgstr "Установка закончена"
+msgstr "Установка завершена"
 
 #: ../utils/setup.c:1237
 msgid ""
@@ -315,6 +384,9 @@
 "setup program now; otherwise, run './citadel'\n"
 "to log in.\n"
 msgstr ""
+"Установка Citadel завершена.\n"
+"Если вы собираетесь использовать Webcit, установите его.\n"
+"Либо запустите ./citadel чтобы приступить к работе прямо сейчас.\n"
 
 #: ../utils/setup.c:1243
 msgid "Setup failed"
@@ -325,10 +397,12 @@
 "Setup is finished, but the Citadel server failed to start.\n"
 "Go back and check your configuration.\n"
 msgstr ""
+"Установка завершена, но программе setup не удалось запустить Citadel.\n"
+"Пожалуйста, перепроверьте все настройки.\n"
 
 #: ../utils/setup.c:1253
 msgid "Setup is finished.  You may now start the server."
-msgstr "Установка закончена. Можете перезагрузить сервер."
+msgstr "Настройка завершена, можно запускать Citadel."
 
 #: ../utils/setup.c:1279
 msgid "My System"
@@ -340,12 +414,12 @@
 
 #: ../utils/setup.c:1368 ../utils/setup.c:1373
 msgid "setup: cannot append"
-msgstr ""
+msgstr "Программа setup: невозможно добавить"
 
 #: ../utils/setup.c:1450 ../utils/setup.c:1457 ../utils/setup.c:1472
 #: ../utils/setup.c:1512
 msgid "Citadel Setup"
-msgstr "Установка Citadel"
+msgstr "Программа setup"
 
 #: ../utils/setup.c:1459
 msgid "The directory you specified does not exist"
@@ -356,20 +430,20 @@
 "The Citadel service is still running.\n"
 "Please stop the service manually and run setup again."
 msgstr ""
-"Сервис Citadel запущен.\n"
-"Остановите сервис самостоятельно и запустите установку снова."
+"Даемон Citadel в данный момент запущен.\n"
+"Остановите его и перезапустите программу setup."
 
 #: ../utils/setup.c:1485
 msgid "Citadel setup program"
-msgstr "Программа установки Citadel"
+msgstr "Программа setup"
 
 #: ../utils/setup.c:1513
 msgid "This Citadel installation is too old to be upgraded."
-msgstr ""
+msgstr "Увы, ваша Citadel слишком устарела и не может быть обновлена"
 
 #: ../utils/setup.c:1552 ../utils/setup.c:1554 ../utils/setup.c:1556
 msgid "Setting file permissions"
-msgstr "Установка разрешений файла"
+msgstr "Устанавливаются права доступа к файлам"
 
 #~ msgid ""
 #~ "Please specify the IP address which the server should be listening to. If "
diff -Nru citadel-8.11/room_ops.c citadel-8.12/room_ops.c
--- citadel-8.11/room_ops.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/room_ops.c	2012-06-26 17:56:25.000000000 +0200
@@ -994,7 +994,7 @@
 	for (a=0; a<num_msgs; ++a) {
 		if (msglist[a] > 0L) ++total_messages;
 	}
-	new_messages = num_msgs;
+
 	num_sets = num_tokens(vbuf.v_seen, ',');
 	for (s=0; s<num_sets; ++s) {
 		extract_token(setstr, vbuf.v_seen, s, ',', sizeof setstr);
diff -Nru citadel-8.11/server_main.c citadel-8.12/server_main.c
--- citadel-8.11/server_main.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/server_main.c	2012-06-26 17:56:25.000000000 +0200
@@ -371,7 +371,7 @@
 	}
 
 	/* We want to check for idle sessions once per minute */
-	CtdlRegisterSessionHook(terminate_idle_sessions, EVT_TIMER);
+	CtdlRegisterSessionHook(terminate_idle_sessions, EVT_TIMER, PRIO_CLEANUP + 1);
 
 	go_threading();
 	
diff -Nru citadel-8.11/serv_extensions.c citadel-8.12/serv_extensions.c
--- citadel-8.11/serv_extensions.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/serv_extensions.c	2012-06-26 17:56:25.000000000 +0200
@@ -87,6 +87,7 @@
 typedef struct SessionFunctionHook SessionFunctionHook;
 struct SessionFunctionHook {
 	SessionFunctionHook *next;
+	int Priority;
 	void (*h_function_pointer) (void);
 	int eventtype;
 };
@@ -493,20 +494,29 @@
 
 void CtdlUnregisterCleanupHook(void (*fcn_ptr) (void))
 {
-	CleanupFunctionHook *cur, *p;
-
-	for (cur = CleanupHookTable; cur != NULL; cur = cur->next) {
-		/* This will also remove duplicates if any */
-		while (cur != NULL &&
-				fcn_ptr == cur->h_function_pointer) {
+	CleanupFunctionHook *cur, *p, *last;
+	last = NULL;
+	cur = CleanupHookTable;
+	while (cur != NULL)
+	{
+		if (fcn_ptr == cur->h_function_pointer)
+		{
 			MODM_syslog(LOG_DEBUG, "Unregistered cleanup function\n");
 			p = cur->next;
-			if (cur == CleanupHookTable) {
-				CleanupHookTable = p;
-			}
+
 			free(cur);
+			cur = NULL;
+
+			if (last != NULL)
+				last->next = p;
+			else 
+				CleanupHookTable = p;
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -543,20 +553,29 @@
 
 void CtdlUnregisterEVCleanupHook(void (*fcn_ptr) (void))
 {
-	CleanupFunctionHook *cur, *p;
-
-	for (cur = EVCleanupHookTable; cur != NULL; cur = cur->next) {
-		/* This will also remove duplicates if any */
-		while (cur != NULL &&
-				fcn_ptr == cur->h_function_pointer) {
+	CleanupFunctionHook *cur, *p, *last;
+	last = NULL;
+	cur = EVCleanupHookTable;
+	while (cur != NULL)
+	{
+		if (fcn_ptr == cur->h_function_pointer)
+		{
 			MODM_syslog(LOG_DEBUG, "Unregistered cleanup function\n");
 			p = cur->next;
-			if (cur == EVCleanupHookTable) {
-				EVCleanupHookTable = p;
-			}
+
 			free(cur);
+			cur = NULL;
+
+			if (last != NULL)
+				last->next = p;
+			else 
+				EVCleanupHookTable = p;
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -577,41 +596,57 @@
 }
 
 
-void CtdlRegisterSessionHook(void (*fcn_ptr) (void), int EventType)
+void CtdlRegisterSessionHook(void (*fcn_ptr) (void), int EventType, int Priority)
 {
-
 	SessionFunctionHook *newfcn;
 
 	newfcn = (SessionFunctionHook *)
 	    malloc(sizeof(SessionFunctionHook));
-	newfcn->next = SessionHookTable;
+	newfcn->Priority = Priority;
 	newfcn->h_function_pointer = fcn_ptr;
 	newfcn->eventtype = EventType;
-	SessionHookTable = newfcn;
 
-	MOD_syslog(LOG_DEBUG, "Registered a new session function (type %d)\n",
-		   EventType);
+	SessionFunctionHook **pfcn;
+	pfcn = &SessionHookTable;
+	while ((*pfcn != NULL) && 
+	       ((*pfcn)->Priority < newfcn->Priority) &&
+	       ((*pfcn)->next != NULL))
+		pfcn = &(*pfcn)->next;
+		
+	newfcn->next = *pfcn;
+	*pfcn = newfcn;
+	
+	MOD_syslog(LOG_DEBUG, "Registered a new session function (type %d Priority %d)\n",
+		   EventType, Priority);
 }
 
 
 void CtdlUnregisterSessionHook(void (*fcn_ptr) (void), int EventType)
 {
-	SessionFunctionHook *cur, *p;
-
-	for (cur = SessionHookTable; cur != NULL; cur = cur->next) {
-		/* This will also remove duplicates if any */
-		while (cur != NULL &&
-				fcn_ptr == cur->h_function_pointer &&
-				EventType == cur->eventtype) {
+	SessionFunctionHook *cur, *p, *last;
+	last = NULL;
+	cur = SessionHookTable;
+	while  (cur != NULL) {
+		if ((fcn_ptr == cur->h_function_pointer) &&
+		    (EventType == cur->eventtype))
+		{
 			MOD_syslog(LOG_DEBUG, "Unregistered session function (type %d)\n",
 				   EventType);
 			p = cur->next;
-			if (cur == SessionHookTable) {
-				SessionHookTable = p;
-			}
+
 			free(cur);
+			cur = NULL;
+
+			if (last != NULL)
+				last->next = p;
+			else 
+				SessionHookTable = p;
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -650,22 +685,30 @@
 
 void CtdlUnregisterUserHook(void (*fcn_ptr) (struct ctdluser *), int EventType)
 {
-	UserFunctionHook *cur, *p;
-
-	for (cur = UserHookTable; cur != NULL; cur = cur->next) {
-		/* This will also remove duplicates if any */
-		while (cur != NULL &&
-				fcn_ptr == cur->h_function_pointer &&
-				EventType == cur->eventtype) {
+	UserFunctionHook *cur, *p, *last;
+	last = NULL;
+	cur = UserHookTable;
+	while (cur != NULL) {
+		if ((fcn_ptr == cur->h_function_pointer) &&
+		    (EventType == cur->eventtype))
+		{
 			MOD_syslog(LOG_DEBUG, "Unregistered user function (type %d)\n",
 				   EventType);
 			p = cur->next;
-			if (cur == UserHookTable) {
-				UserHookTable = p;
-			}
+
 			free(cur);
+			cur = NULL;
+
+			if (last != NULL)
+				last->next = p;
+			else 
+				UserHookTable = p;
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -706,22 +749,29 @@
 void CtdlUnregisterMessageHook(int (*handler)(struct CtdlMessage *),
 		int EventType)
 {
-	MessageFunctionHook *cur, *p;
-
-	for (cur = MessageHookTable; cur != NULL; cur = cur->next) {
-		/* This will also remove duplicates if any */
-		while (cur != NULL &&
-				handler == cur->h_function_pointer &&
-				EventType == cur->eventtype) {
+	MessageFunctionHook *cur, *p, *last;
+	last = NULL;
+	cur = MessageHookTable;
+	while (cur != NULL) {
+		if ((handler == cur->h_function_pointer) &&
+		    (EventType == cur->eventtype))
+		{
 			MOD_syslog(LOG_DEBUG, "Unregistered message function (type %d)\n",
 				   EventType);
 			p = cur->next;
-			if (cur == MessageHookTable) {
-				MessageHookTable = p;
-			}
 			free(cur);
+			cur = NULL;
+
+			if (last != NULL)
+				last->next = p;
+			else 
+				MessageHookTable = p;
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -757,18 +807,28 @@
 
 void CtdlUnregisterRoomHook(int (*fcn_ptr)(struct ctdlroom *))
 {
-	RoomFunctionHook *cur, *p;
-
-	for (cur = RoomHookTable; cur != NULL; cur = cur->next) {
-		while (cur != NULL && fcn_ptr == cur->fcn_ptr) {
+	RoomFunctionHook *cur, *p, *last;
+	last = NULL;
+	cur = RoomHookTable;
+	while (cur != NULL)
+	{
+		if (fcn_ptr == cur->fcn_ptr) {
 			MODM_syslog(LOG_DEBUG, "Unregistered room function\n");
 			p = cur->next;
-			if (cur == RoomHookTable) {
-				RoomHookTable = p;
-			}
+
 			free(cur);
+			cur = NULL;
+
+			if (last != NULL)
+				last->next = p;
+			else 
+				RoomHookTable = p;
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -804,20 +864,29 @@
 
 void CtdlUnregisterNetprocHook(int (*handler)(struct CtdlMessage *, char *) )
 {
-	NetprocFunctionHook *cur, *p;
+	NetprocFunctionHook *cur, *p, *last;
 
-	for (cur = NetprocHookTable; cur != NULL; cur = cur->next) {
-		/* This will also remove duplicates if any */
-		while (cur != NULL &&
-				handler == cur->h_function_pointer ) {
+	cur = NetprocHookTable;
+	last = NULL;
+
+	while (cur != NULL) {
+		if (handler == cur->h_function_pointer)
+		{
 			MODM_syslog(LOG_DEBUG, "Unregistered netproc function\n");
 			p = cur->next;
-			if (cur == NetprocHookTable) {
+			free(cur);
+			if (last != NULL) {
+				last->next = p;
+			}
+			else {
 				NetprocHookTable = p;
 			}
-			free(cur);
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -853,20 +922,28 @@
 
 void CtdlUnregisterDeleteHook(void (*handler)(char *, long) )
 {
-	DeleteFunctionHook *cur, *p;
+	DeleteFunctionHook *cur, *p, *last;
 
-	for (cur = DeleteHookTable; cur != NULL; cur = cur->next) {
-		/* This will also remove duplicates if any */
-		while (cur != NULL &&
-				handler == cur->h_function_pointer ) {
+	last = NULL;
+	cur = DeleteHookTable;
+	while (cur != NULL) {
+		if (handler == cur->h_function_pointer )
+		{
 			MODM_syslog(LOG_DEBUG, "Unregistered delete function\n");
 			p = cur->next;
-			if (cur == DeleteHookTable) {
-				DeleteHookTable = p;
-			}
 			free(cur);
+
+			if (last != NULL)
+				last->next = p;
+			else
+				DeleteHookTable = p;
+
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 void CtdlDestroyDeleteHooks(void)
@@ -904,19 +981,32 @@
 
 void CtdlUnregisterFixedOutputHook(char *content_type)
 {
-	FixedOutputHook *cur, *p;
+	FixedOutputHook *cur, *p, *last;
 
-	for (cur = FixedOutputTable; cur != NULL; cur = cur->next) {
+	last = NULL;
+	cur = FixedOutputTable;
+	while (cur != NULL) {
 		/* This will also remove duplicates if any */
-		while (cur != NULL && (!strcasecmp(content_type, cur->content_type))) {
-			MOD_syslog(LOG_DEBUG, "Unregistered fixed output function for %s\n", content_type);
+		if (!strcasecmp(content_type, cur->content_type)) {
+			MOD_syslog(LOG_DEBUG,
+				   "Unregistered fixed output function for %s\n",
+				   content_type);
+
 			p = cur->next;
-			if (cur == FixedOutputTable) {
-				FixedOutputTable = p;
-			}
 			free(cur);
+
+			if (last != NULL)
+				last->next = p;
+			else
+				FixedOutputTable = p;
+			
 			cur = p;
 		}
+		else
+		{
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -970,22 +1060,30 @@
 
 void CtdlUnregisterXmsgHook(int (*fcn_ptr) (char *, char *, char *, char *), int order)
 {
-	XmsgFunctionHook *cur, *p;
+	XmsgFunctionHook *cur, *p, *last;
 
-	for (cur = XmsgHookTable; cur != NULL; cur = cur->next) {
+	last = NULL;
+	cur = XmsgHookTable;
+	while (cur != NULL) {
 		/* This will also remove duplicates if any */
-		while (cur != NULL &&
-				fcn_ptr == cur->h_function_pointer &&
-				order == cur->order) {
+		if (fcn_ptr == cur->h_function_pointer &&
+		    order == cur->order) {
 			MOD_syslog(LOG_DEBUG, "Unregistered x-msg function "
 				   "(priority %d)\n", order);
 			p = cur->next;
-			if (cur == XmsgHookTable) {
-				XmsgHookTable = p;
-			}
 			free(cur);
+
+			if (last != NULL)
+				last->next = p;
+			else
+				XmsgHookTable = p;
+			
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -1070,19 +1168,20 @@
 			void (*h_async_function) (void)
 			)
 {
-	ServiceFunctionHook *cur, *p;
+	ServiceFunctionHook *cur, *p, *last;
 
+	last = NULL;
 	cur = ServiceHookTable;
 	while (cur != NULL) {
 		/* This will also remove duplicates if any */
-		while (cur != NULL &&
-				!(sockpath && cur->sockpath &&
-					strcmp(sockpath, cur->sockpath)) &&
-				h_greeting_function == cur->h_greeting_function &&
-				h_command_function == cur->h_command_function &&
-				h_async_function == cur->h_async_function &&
-				tcp_port == cur->tcp_port) {
-			close(cur->msock);
+		if (h_greeting_function == cur->h_greeting_function &&
+		    h_command_function == cur->h_command_function &&
+		    h_async_function == cur->h_async_function &&
+		    tcp_port == cur->tcp_port && 
+		    !(sockpath && cur->sockpath && strcmp(sockpath, cur->sockpath)) )
+		{
+			if (cur->msock > 0)
+				close(cur->msock);
 			if (sockpath) {
 				MOD_syslog(LOG_INFO, "Closed UNIX domain socket %s\n",
 					   sockpath);
@@ -1093,12 +1192,17 @@
 				MOD_syslog(LOG_INFO, "Unregistered service \"%s\"\n", cur->ServiceName);
 			}
 			p = cur->next;
-			if (cur == ServiceHookTable) {
-				ServiceHookTable = p;
-			}
 			free(cur);
+			if (last != NULL)
+				last->next = p;
+			else
+				ServiceHookTable = p;
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
@@ -1173,18 +1277,28 @@
 
 void CtdlUnregisterSearchFuncHook(void (*fcn_ptr)(int *, long **, const char *), char *name)
 {
-	SearchFunctionHook *cur, *p;
+	SearchFunctionHook *cur, *p, *last;
 	
-	for (cur = SearchFunctionHookTable; cur != NULL; cur = cur->next) {
-		while (fcn_ptr && (cur->fcn_ptr == fcn_ptr) && name && !strcmp(name, cur->name)) {
+	last = NULL;
+	cur = SearchFunctionHookTable;
+	while (cur != NULL) {
+		if (fcn_ptr &&
+		    (cur->fcn_ptr == fcn_ptr) &&
+		    name && !strcmp(name, cur->name))
+		{
 			MOD_syslog(LOG_DEBUG, "Unregistered search function(%s)\n", name);
 			p = cur->next;
-			if (cur == SearchFunctionHookTable) {
-				SearchFunctionHookTable = p;
-			}
 			free (cur);
+			if (last != NULL)
+				last->next = p;
+			else
+				SearchFunctionHookTable = p;
 			cur = p;
 		}
+		else {
+			last = cur;
+			cur = cur->next;
+		}
 	}
 }
 
diff -Nru citadel-8.11/svn_revision.c citadel-8.12/svn_revision.c
--- citadel-8.11/svn_revision.c	2012-05-22 17:14:52.000000000 +0200
+++ citadel-8.12/svn_revision.c	2012-06-26 17:56:30.000000000 +0200
@@ -9,6 +9,6 @@
  
 const char *svn_revision (void)
 {
-	const char *SVN_Version = "96550b1";
+	const char *SVN_Version = "452067d";
 	return SVN_Version;
 }
diff -Nru citadel-8.11/sysdep.c citadel-8.12/sysdep.c
--- citadel-8.11/sysdep.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/sysdep.c	2012-06-26 17:56:25.000000000 +0200
@@ -1052,7 +1052,7 @@
 			}
 			waitpid(current_child, &status, 0);
 		}
-		do_restart = 0;
+
 		nFireUpsNonRestart = nFireUps;
 		
 		/* Exit code 0 means the watcher should exit */
diff -Nru citadel-8.11/techdoc/developers.txt citadel-8.12/techdoc/developers.txt
--- citadel-8.11/techdoc/developers.txt	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/techdoc/developers.txt	2012-06-26 17:56:25.000000000 +0200
@@ -19,6 +19,7 @@
 	7	Shaggy (new)	unknown		Java-powered client
 						<chilly@uncensored.citadel.org>
 	8	ctdlphp		deployed	PHP interface to Citadel
+	9	z-push		in development	Citadel backend for Z-Push
  
  1	Brian Ledbetter <brian@shadowcom.net>
 
diff -Nru citadel-8.11/user_ops.c citadel-8.12/user_ops.c
--- citadel-8.11/user_ops.c	2012-05-22 17:14:47.000000000 +0200
+++ citadel-8.12/user_ops.c	2012-06-26 17:56:25.000000000 +0200
@@ -945,7 +945,6 @@
 		CONM_syslog(LOG_INFO, "CtdlTryPassword: NULL password string supplied\n");
 		return pass_wrong_password;
 	}
-	code = (-1);
 
 	if (CCC->is_master) {
 		code = strcmp(password, config.c_master_pass);
@@ -1004,9 +1003,11 @@
 		strproc(pw);
 		strproc(CCC->user.password);
 		code = strcasecmp(CCC->user.password, pw);
-		strproc(pw);
-		strproc(CCC->user.password);
-		code = strcasecmp(CCC->user.password, pw);
+		if (code != 0) {
+			strproc(pw);
+			strproc(CCC->user.password);
+			code = strcasecmp(CCC->user.password, pw);
+		}
 		free (pw);
 	}
 
diff -Nru webcit-8.11-dfsg/autom4te.cache/output.0 webcit-8.12-dfsg/autom4te.cache/output.0
--- webcit-8.11-dfsg/autom4te.cache/output.0	2012-05-22 17:14:58.000000000 +0200
+++ webcit-8.12-dfsg/autom4te.cache/output.0	2012-06-26 17:56:36.000000000 +0200
@@ -1,6 +1,6 @@
 @%:@! /bin/sh
 @%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.67 for WebCit 8.11.
+@%:@ Generated by GNU Autoconf 2.67 for WebCit 8.12.
 @%:@
 @%:@ Report bugs to <http://www.citadel.org/>.
 @%:@ 
@@ -552,8 +552,8 @@
 # Identity of this package.
 PACKAGE_NAME='WebCit'
 PACKAGE_TARNAME='webcit'
-PACKAGE_VERSION='8.11'
-PACKAGE_STRING='WebCit 8.11'
+PACKAGE_VERSION='8.12'
+PACKAGE_STRING='WebCit 8.12'
 PACKAGE_BUGREPORT='http://www.citadel.org/'
 PACKAGE_URL=''
 
@@ -1233,7 +1233,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures WebCit 8.11 to adapt to many kinds of systems.
+\`configure' configures WebCit 8.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1298,7 +1298,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of WebCit 8.11:";;
+     short | recursive ) echo "Configuration of WebCit 8.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1397,7 +1397,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-WebCit configure 8.11
+WebCit configure 8.12
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1998,7 +1998,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by WebCit $as_me 8.11, which was
+It was created by WebCit $as_me 8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -6564,7 +6564,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by WebCit $as_me 8.11, which was
+This file was extended by WebCit $as_me 8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6626,7 +6626,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-WebCit config.status 8.11
+WebCit config.status 8.12
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff -Nru webcit-8.11-dfsg/autom4te.cache/traces.0 webcit-8.12-dfsg/autom4te.cache/traces.0
--- webcit-8.11-dfsg/autom4te.cache/traces.0	2012-05-22 17:14:58.000000000 +0200
+++ webcit-8.12-dfsg/autom4te.cache/traces.0	2012-06-26 17:56:36.000000000 +0200
@@ -1,5 +1,5 @@
 m4trace:aclocal.m4:110: -1- m4_include([acinclude.m4])
-m4trace:configure.ac:3: -1- AC_INIT([WebCit], [8.11], [http://www.citadel.org/])
+m4trace:configure.ac:3: -1- AC_INIT([WebCit], [8.12], [http://www.citadel.org/])
 m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?A[CHUM]_])
 m4trace:configure.ac:3: -1- m4_pattern_forbid([_AC_])
 m4trace:configure.ac:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
diff -Nru webcit-8.11-dfsg/configure webcit-8.12-dfsg/configure
--- webcit-8.11-dfsg/configure	2012-05-22 17:14:57.000000000 +0200
+++ webcit-8.12-dfsg/configure	2012-06-26 17:56:35.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for WebCit 8.11.
+# Generated by GNU Autoconf 2.67 for WebCit 8.12.
 #
 # Report bugs to <http://www.citadel.org/>.
 #
@@ -552,8 +552,8 @@
 # Identity of this package.
 PACKAGE_NAME='WebCit'
 PACKAGE_TARNAME='webcit'
-PACKAGE_VERSION='8.11'
-PACKAGE_STRING='WebCit 8.11'
+PACKAGE_VERSION='8.12'
+PACKAGE_STRING='WebCit 8.12'
 PACKAGE_BUGREPORT='http://www.citadel.org/'
 PACKAGE_URL=''
 
@@ -1233,7 +1233,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures WebCit 8.11 to adapt to many kinds of systems.
+\`configure' configures WebCit 8.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1298,7 +1298,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of WebCit 8.11:";;
+     short | recursive ) echo "Configuration of WebCit 8.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1397,7 +1397,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-WebCit configure 8.11
+WebCit configure 8.12
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1998,7 +1998,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by WebCit $as_me 8.11, which was
+It was created by WebCit $as_me 8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -6564,7 +6564,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by WebCit $as_me 8.11, which was
+This file was extended by WebCit $as_me 8.12, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6626,7 +6626,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-WebCit config.status 8.11
+WebCit config.status 8.12
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff -Nru webcit-8.11-dfsg/configure.ac webcit-8.12-dfsg/configure.ac
--- webcit-8.11-dfsg/configure.ac	2012-05-22 17:14:47.000000000 +0200
+++ webcit-8.12-dfsg/configure.ac	2012-06-26 17:56:25.000000000 +0200
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
-AC_INIT([WebCit], [8.11], [http://www.citadel.org/])
+AC_INIT([WebCit], [8.12], [http://www.citadel.org/])
 
 
 AC_SUBST(PROG_SUBDIRS)
diff -Nru webcit-8.11-dfsg/debian/changelog webcit-8.12-dfsg/debian/changelog
--- webcit-8.11-dfsg/debian/changelog	2012-07-02 14:07:37.000000000 +0200
+++ webcit-8.12-dfsg/debian/changelog	2012-07-02 14:07:37.000000000 +0200
@@ -1,3 +1,9 @@
+webcit (8.12-dfsg-1) unstable; urgency=low
+
+  * Imported Upstream version 8.12-dfsg
+
+ -- Michael Meskes <meskes@debian.org>  Thu, 28 Jun 2012 11:01:58 +0200
+
 webcit (8.11-dfsg-2) unstable; urgency=low
 
   * Added build dependency on libexpat1-dev. (Closes: #676064)
diff -Nru webcit-8.11-dfsg/debian/control webcit-8.12-dfsg/debian/control
--- webcit-8.11-dfsg/debian/control	2012-07-02 14:07:37.000000000 +0200
+++ webcit-8.12-dfsg/debian/control	2012-07-02 14:07:37.000000000 +0200
@@ -4,7 +4,7 @@
 Maintainer: Debian Citadel Team <pkg-citadel-devel@lists.alioth.debian.org>
 Uploaders: Wilfried Goesgens <w.goesgens@outgesourced.org>, Michael Meskes <meskes@debian.org>, Alexander Wirt <formorer@debian.org>
 Build-Depends: debhelper (>= 7.0.50~), po-debconf, libical-dev (>=0.43), gettext, locales,
- libcitadel-dev (>= 8.11), autotools-dev, libssl-dev, libexpat1-dev
+ libcitadel-dev (>= 8.12), autotools-dev, libssl-dev, libexpat1-dev
 Standards-Version: 3.9.3
 Vcs-Git: git://git.debian.org/git/pkg-citadel/webcit.git
 Vcs-Browser: http://git.debian.org/?p=pkg-citadel/webcit.git
diff -Nru webcit-8.11-dfsg/locate_host.c webcit-8.12-dfsg/locate_host.c
--- webcit-8.11-dfsg/locate_host.c	2012-05-22 17:14:47.000000000 +0200
+++ webcit-8.12-dfsg/locate_host.c	2012-06-26 17:56:25.000000000 +0200
@@ -22,7 +22,7 @@
 {
 	struct sockaddr_in6 clientaddr;
 	unsigned int addrlen = sizeof(clientaddr);
-	char clienthost[NI_MAXHOST];
+	char clienthost[NI_MAXHOST] = "";
 
 	getpeername(client_socket, (struct sockaddr *)&clientaddr, &addrlen);
 	getnameinfo((struct sockaddr *)&clientaddr, addrlen, clienthost, sizeof(clienthost), NULL, 0, 0);
diff -Nru webcit-8.11-dfsg/messages.c webcit-8.12-dfsg/messages.c
--- webcit-8.11-dfsg/messages.c	2012-05-22 17:14:47.000000000 +0200
+++ webcit-8.12-dfsg/messages.c	2012-06-26 17:56:25.000000000 +0200
@@ -37,6 +37,15 @@
 	MsgPartEvaluatorFunc f;
 } MsgPartEvaluatorStruct;
 
+void fixview()
+{
+	/* workaround for json listview; its not useable directly */
+	if (WC->CurRoom.view == VIEW_JSON_LIST) {
+		StrBuf *View = NewStrBuf();
+		StrBufPrintf(View, "%d", VIEW_MAILBOX);
+		putbstr("view", View);;
+	}
+}
 int load_message(message_summary *Msg, 
 		 StrBuf *FoundCharset,
 		 StrBuf **Error)
@@ -1123,6 +1132,7 @@
 				if (saving_to_drafts) {
 					AppendImportantMessage(_("Message has been saved to Drafts.\n"), -1);
 					gotoroom(WCC->CurRoom.name);
+					fixview();
 					readloop(readnew, eUseDefault);
 					FreeStrBuf(&Buf);
 					return;
@@ -1174,6 +1184,7 @@
 	 *  Otherwise, just go to the "read messages" loop.
 	 */
 	else {
+		fixview();
 		readloop(readnew, eUseDefault);
 	}
 }
@@ -1345,6 +1356,7 @@
 	}
 	else if (rc != 2) {		/* Any other error means that we cannot continue */
 		rc = GetServerStatusMsg(Line, &Result, 0, 2);
+		fixview();
 		readloop(readnew, eUseDefault);
 		FreeStrBuf(&Line);
 		return;
@@ -1616,6 +1628,7 @@
 		else if (rc != 2) {	/* Any other error means that we cannot continue */
 			AppendImportantMessage(ChrPtr(CmdBuf) + 4, StrLength(CmdBuf) - 4);
 			FreeStrBuf(&CmdBuf);
+			fixview();
 			readloop(readnew, eUseDefault);
 			return;
 		}
@@ -1654,6 +1667,8 @@
 	StrBuf_ServGetln(Line);
 	GetServerStatusMsg(Line, NULL, 1, 0);
 
+	fixview();
+
 	readloop(readnew, eUseDefault);
 }
 
@@ -1678,6 +1693,7 @@
 		AppendImportantMessage(_("The message was not moved."), -1);
 	}
 
+	fixview();
 	readloop(readnew, eUseDefault);
 }
 
diff -Nru webcit-8.11-dfsg/po/webcit/bg.po webcit-8.12-dfsg/po/webcit/bg.po
--- webcit-8.11-dfsg/po/webcit/bg.po	2012-05-22 17:14:47.000000000 +0200
+++ webcit-8.12-dfsg/po/webcit/bg.po	2012-06-26 17:56:25.000000000 +0200
@@ -8,15 +8,16 @@
 "Project-Id-Version: citadel\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2012-03-20 01:03-0400\n"
-"PO-Revision-Date: 2011-01-25 22:18+0000\n"
-"Last-Translator: Citadel <Unknown>\n"
+"PO-Revision-Date: 2012-03-12 09:09+0000\n"
+"Last-Translator: Валери Фиков <v@fikov.com>\n"
 "Language-Team: Bulgarian <bg@li.org>\n"
 "Language: bg\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-02-25 04:33+0000\n"
-"X-Generator: Launchpad (build 12351)\n"
+"X-Launchpad-Export-Date: 2012-03-21 04:47+0000\n"
+"X-Generator: Launchpad (build 14981)\n"
+"Language: bg\n"
 
 #: ../../roomops.c:708 ../../roomops.c:1005 ../../sieve.c:364
 msgid "Cancelled.  Changes were not saved."
@@ -705,6 +706,9 @@
 "any additional logins at this time.  Please try again later or contact your "
 "system administrator."
 msgstr ""
+"Този сървър е вече обслужва максимален брой потребители и не може да "
+"обслужва повече потребители в този момент. Моля, опитайте отново по-късно "
+"или се свържете с вашия системен администратор."
 
 #: ../../serv_func.c:198 ../../serv_func.c:227
 msgid "Received unexpected answer from Citadel server; bailing out."
@@ -719,6 +723,11 @@
 "\n"
 "\n"
 msgstr ""
+"Вие сте свързан към Citadel сървър работещ с Citadel %d.%02d. \n"
+"За да стартирате тази версия на WebCit, трябва да имате също Citadel %d.%02d "
+"или по-нова.\n"
+"\n"
+"\n"
 
 #: ../../event.c:70
 msgid "seconds"
diff -Nru webcit-8.11-dfsg/po/webcit/cs.po webcit-8.12-dfsg/po/webcit/cs.po
--- webcit-8.11-dfsg/po/webcit/cs.po	2012-05-22 17:14:47.000000000 +0200
+++ webcit-8.12-dfsg/po/webcit/cs.po	2012-06-26 17:56:25.000000000 +0200
@@ -8,28 +8,28 @@
 "Project-Id-Version: citadel\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2012-03-20 01:03-0400\n"
-"PO-Revision-Date: 2012-02-16 19:19+0000\n"
-"Last-Translator: Zdenek Dlauhy <Unknown>\n"
+"PO-Revision-Date: 2012-04-05 06:55+0000\n"
+"Last-Translator: Dahomír Přikryl <Unknown>\n"
 "Language-Team: Czech <cs@li.org>\n"
-"Language: cs\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-02-17 04:53+0000\n"
-"X-Generator: Launchpad (build 14814)\n"
+"X-Launchpad-Export-Date: 2012-04-06 04:32+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
+"Language: cs\n"
 
 #: ../../roomops.c:708 ../../roomops.c:1005 ../../sieve.c:364
 msgid "Cancelled.  Changes were not saved."
-msgstr "Zrušeno, změny se neuloží."
+msgstr "Zrušeno. Změny se neuloží."
 
 #: ../../roomops.c:838 ../../sieve.c:417
 msgid "Your changes have been saved."
-msgstr "Vaše změny se uložily."
+msgstr "Vaše změny byly uloženy."
 
 #: ../../roomops.c:881
 #, c-format
 msgid "User '%s' kicked out of room '%s'."
-msgstr ""
+msgstr "Uživatel '%s' byl vykopnut z místnosti '%s'."
 
 #: ../../roomops.c:898
 #, c-format
@@ -38,7 +38,7 @@
 
 #: ../../roomops.c:927
 msgid "Cancelled.  No new room was created."
-msgstr "Zrušeno. Žádná nová místnost"
+msgstr "Zrušeno. Žádná nová místnost."
 
 #: ../../roomops.c:1187
 msgid "Floor has been deleted."
@@ -50,11 +50,11 @@
 
 #: ../../roomops.c:1290
 msgid "Room list view"
-msgstr ""
+msgstr "Pohled na místnosti"
 
 #: ../../roomops.c:1293
 msgid "Show empty floors"
-msgstr "Zobrazit prázná podlaží"
+msgstr "Zobrazit prázdná podlaží"
 
 #: ../../roomviews.c:50
 msgid "Bulletin Board"
@@ -91,7 +91,7 @@
 
 #: ../../roomviews.c:58
 msgid "Journal"
-msgstr "Časopis"
+msgstr "Deník"
 
 #: ../../roomviews.c:59
 msgid "Drafts"
@@ -103,7 +103,7 @@
 
 #: ../../tasks.c:93
 msgid "Completed?"
-msgstr "Hotovo?"
+msgstr "Dokončeno?"
 
 #: ../../tasks.c:95
 msgid "Name of task"
@@ -111,7 +111,7 @@
 
 #: ../../tasks.c:97
 msgid "Date due"
-msgstr "Povinná data"
+msgstr "Plánované dokončení"
 
 #: ../../tasks.c:99
 msgid "Category"
@@ -133,7 +133,7 @@
 
 #: ../../tasks.c:253
 msgid "Start date:"
-msgstr "Počáteční datum:"
+msgstr "Začátek:"
 
 #: ../../tasks.c:261 ../../tasks.c:291
 msgid "No date"
@@ -145,11 +145,11 @@
 
 #: ../../tasks.c:279 ../../tasks.c:308
 msgid "Time associated"
-msgstr "Přiřezený čas"
+msgstr "Přiřazený čas"
 
 #: ../../tasks.c:283
 msgid "Due date:"
-msgstr "Do:"
+msgstr "Konec:"
 
 #: ../../tasks.c:312
 msgid "Completed:"
@@ -211,19 +211,24 @@
 "without your consent.<br><br>Please click on the link which is being e-"
 "mailed to you and your subscription will be confirmed.<br>\n"
 msgstr ""
+"Zaregistroval jste se <TT>%s</TT> do <b>%s</b> distribučního seznamu. "
+"Seznamový server Vám poslal mail s webovým odkazem, kterým potvrdíte své "
+"přihlášení. Tento zvláštní krok je pro Vaši ochranu, aby Vás zapsali na "
+"seznam bez Vašeho vědomí. Prosím klikněte na odkaz, který Vám byl poslán a "
+"Vaše registrace bude potvrzena. <br>\n"
 
 #: ../../listsub.c:102 ../../static/t/listsub/display.html:24
 msgid "Go back..."
-msgstr "Zpět"
+msgstr "Zpět..."
 
 #: ../../listsub.c:253 ../../listsub.c:291 ../../listsub.c:327
 #: ../../listsub.c:334
 msgid "You need to specify the mailinglist to subscribe to."
-msgstr ""
+msgstr "Musíte zadat poštovní seznam, který chcete použít."
 
 #: ../../listsub.c:260 ../../listsub.c:298
 msgid "You need to specify the email address you'd like to subscribe with."
-msgstr ""
+msgstr "Musíte zadat poštovní adresu, kterou chcete použít."
 
 #: ../../blogview_renderer.c:58 ../../blogview_renderer.c:74
 #, c-format
@@ -236,11 +241,11 @@
 
 #: ../../blogview_renderer.c:302
 msgid "Newer posts"
-msgstr "novější příspěvků"
+msgstr "Novější příspěvky"
 
 #: ../../blogview_renderer.c:311
 msgid "Older posts"
-msgstr "starší příspěvky"
+msgstr "Starší příspěvky"
 
 #: ../../useredit.c:629
 msgid ""
@@ -278,7 +283,7 @@
 
 #: ../../graphics.c:56
 msgid "Graphics upload has been cancelled."
-msgstr "Nahrání grafiky bylo zrušeno."
+msgstr "Nahrání obrázku bylo zrušeno."
 
 #: ../../graphics.c:62
 msgid "You didn't upload a file."
@@ -330,7 +335,7 @@
 
 #: ../../calendar_tools.c:216
 msgid "(tenative)"
-msgstr ""
+msgstr "(předběžně)"
 
 #: ../../calendar_tools.c:219
 msgid "(delegated)"
@@ -366,7 +371,7 @@
 
 #: ../../vcard_edit.c:447
 msgid " (cell)"
-msgstr " (buňka)"
+msgstr " (mobil)"
 
 #: ../../vcard_edit.c:458 ../../vcard_edit.c:1120
 msgid "Address:"
@@ -495,7 +500,7 @@
 
 #: ../../preferences.c:880
 msgid "Cancelled.  No settings were changed."
-msgstr "Zrušeno. Žádné nastavení se nezměnilo."
+msgstr "Zrušeno. Nastavení se nezměnilo."
 
 #: ../../preferences.c:1092
 msgid "Make this my start page"
@@ -511,11 +516,11 @@
 
 #: ../../preferences.c:1182
 msgid "Prefered startpage"
-msgstr "Upřednostňovaná strartovní stránka"
+msgstr "Upřednostňovaná startovní stránka"
 
 #: ../../calendar.c:76
 msgid "Meeting invitation"
-msgstr "Pozkánka na schůzku"
+msgstr "Pozvánka na schůzku"
 
 #: ../../calendar.c:79
 msgid "Attendee's reply to your invitation"
@@ -558,7 +563,7 @@
 
 #: ../../calendar.c:178
 msgid "Attendee:"
-msgstr "Přijde:"
+msgstr "Účastník:"
 
 #: ../../calendar.c:218
 #, c-format
@@ -567,7 +572,8 @@
 
 #: ../../calendar.c:222
 #, c-format
-msgid "This event would conflict with '%s' which is already in your calendar."
+msgid ""
+"This event would conflict with '%s' which is already in your calendar."
 msgstr "Tato událost bude v konfliktu s '%s' která už je ve vašem kalendáři."
 
 #: ../../calendar.c:227
@@ -580,7 +586,7 @@
 
 #: ../../calendar.c:251
 msgid "How would you like to respond to this invitation?"
-msgstr "Jak odpověďět na toto pozvání?"
+msgstr "Jak odpovědět na toto pozvání?"
 
 #: ../../calendar.c:252
 msgid "Accept"
@@ -622,12 +628,15 @@
 "You have tentatively accepted this meeting invitation.  It has been "
 "'pencilled in' to your calendar."
 msgstr ""
+"Byl jste předběžně přijat na tuto schůzku. Tato schůzka byla poznačena ve "
+"vašem kalendáři."
 
 #: ../../calendar.c:336
 msgid ""
 "You have declined this meeting invitation.  It has <b>not</b> been entered "
 "into your calendar."
 msgstr ""
+"Zamítl jste pozvání na tuto schůzku. Schůzka nebyla poznačena v kalendáři."
 
 #: ../../calendar.c:341
 msgid "A reply has been sent to the meeting organizer."
@@ -688,10 +697,10 @@
 msgid "Iconbar Setting"
 msgstr "Nastavení Iconbaru"
 
-#.
+#. 
 #. * Set to 'unknown' right from the beginning.  Unless we learn
 #. * something else, that's what we'll go with.
-#.
+#. 
 #: ../../availability.c:148
 msgid "availability unknown"
 msgstr "dostupnost neznámá"
@@ -716,7 +725,7 @@
 
 #: ../../serv_func.c:198 ../../serv_func.c:227
 msgid "Received unexpected answer from Citadel server; bailing out."
-msgstr "Přijata neočekávaná odpověď od Citadel servru"
+msgstr "Přijata neočekávaná odpověď od Citadel servru; zachraňuji se."
 
 #: ../../serv_func.c:236
 #, c-format
@@ -791,7 +800,7 @@
 
 #: ../../event.c:89 ../../event.c:437 ../../event.c:449
 msgid "Attendees"
-msgstr "Návštěvníci"
+msgstr "Účastníci"
 
 #: ../../event.c:167
 msgid "Add or edit an event"
@@ -850,7 +859,7 @@
 #: ../../event.c:450 ../../static/t/edit_message.html:143
 #: ../../static/t/iconbar.html:29 ../../static/t/iconbar/edit.html:42
 msgid "Contacts"
-msgstr "Kotakty"
+msgstr "Kontakty"
 
 #: ../../event.c:513
 msgid "Recurrence rule"
@@ -863,7 +872,7 @@
 #. begin 'weekday_selector' div
 #: ../../event.c:535
 msgid "on these weekdays:"
-msgstr ""
+msgstr "v těchto dnech"
 
 #: ../../event.c:593
 #, c-format
@@ -889,7 +898,7 @@
 #: ../../event.c:688 ../../static/t/msg_listselector_bottom.html:7
 #: ../../static/t/msg_listselector_top.html:7
 msgid "of"
-msgstr ""
+msgstr "z"
 
 #: ../../event.c:712
 msgid "Recurrence range"
@@ -931,11 +940,13 @@
 "Enter %s below. Text is formatted to the reader's browser. A newline is "
 "forced by preceding the next line by a blank."
 msgstr ""
+"Vložte %s dolu. Text je formátován pro prohlížeč návštěvníka. Nová řádka je "
+"vynucena následující druhou prázdnou řádkou."
 
 #: ../../sysmsgs.c:89
 #, c-format
 msgid "Cancelled.  %s was not saved."
-msgstr "Zrušeno, %s se neuloží."
+msgstr "Zrušeno. %s se neuloží."
 
 #: ../../sysmsgs.c:109
 msgid " has been saved."
@@ -947,7 +958,7 @@
 
 #: ../../sysmsgs.c:122 ../../sysmsgs.c:124
 msgid "Your bio"
-msgstr "Vaše biografie"
+msgstr "biografii"
 
 #: ../../calendar_view.c:297 ../../calendar_view.c:958
 #: ../../calendar_view.c:1002 ../../calendar_view.c:1083
@@ -1103,6 +1114,9 @@
 "click the appropriate 'change' button without typing anything in the "
 "corresponding box. "
 msgstr ""
+"Tato obrazovka dovoluje změnit způsob, jakým se zobrazuje seznam \"Kdo je "
+"online\". Pro vypnutí \"falešných\" jmen, před tím nastavených, klikněte na "
+"odpovídající \"změnové\" tlačítko bez psaní do příslušného boxu. "
 
 #: ../../who.c:171
 msgid "Room name:"
@@ -1118,7 +1132,7 @@
 
 #: ../../who.c:185
 msgid "Change host name"
-msgstr "Změnte označení systému"
+msgstr "Změnit označení systému"
 
 #: ../../who.c:190 ../../static/t/aide/edituser/detailview.html:20
 #: ../../static/t/openid_manual_create.html:9
@@ -1138,10 +1152,10 @@
 msgstr "Pro přístup k této funkci jsou zapotřebí vyšší práva."
 
 #: ../../siteconfig.c:256
-msgid "WARNING: Failed to parse Server Config; do you run a to new citserver?"
+msgid ""
+"WARNING: Failed to parse Server Config; do you run a to new citserver?"
 msgstr ""
-"VAROVÁNÍ: Nepodařilo se načíst nastavení servru (Server Config); Chcete "
-"spustit nový Citserver?"
+"VAROVÁNÍ: Nepodařilo se zpracovat nastavení serveru; spustit nový citserver?"
 
 #: ../../siteconfig.c:319
 msgid "Your system configuration has been updated."
@@ -1217,7 +1231,7 @@
 
 #: ../../webcit.c:654 ../../auth.c:532
 msgid "Read More..."
-msgstr "Přečtěte si více…"
+msgstr "Přečtěte více…"
 
 #: ../../smtpqueue.c:134 ../../static/t/aide/ignetconf/section.html:5
 #: ../../static/t/view_mailq/message.html:2
@@ -1226,7 +1240,7 @@
 
 #: ../../smtpqueue.c:334
 msgid "First Attempt pending"
-msgstr ""
+msgstr "První pokus probíhá"
 
 #: ../../roomlist.c:99
 msgid "My Folders"
@@ -1235,7 +1249,7 @@
 #: ../../downloads.c:289
 #, c-format
 msgid "An error occurred while retrieving this file: %s\n"
-msgstr "Došlo k chybě během získávání souboru %s\n"
+msgstr "Došlo k chybě během získávání souboru: %s\n"
 
 #: ../../roomtokens.c:572
 msgid "file"
@@ -1317,7 +1331,7 @@
 #: ../../static/t/aide/siteconfig/tab_access.html:46
 #: ../../static/t/aide/siteconfig/tab_access.html:57
 msgid "Aide"
-msgstr ""
+msgstr "Poradce"
 
 #: ../../auth.c:513 ../../static/t/iconbar.html:80
 #: ../../static/t/confirmlogoff.html:3
@@ -1327,7 +1341,7 @@
 
 #: ../../auth.c:537
 msgid "Log in again"
-msgstr "Přihlaste se znovu"
+msgstr "Přihlašte se znovu"
 
 #: ../../auth.c:585 ../../static/t/aide/usermanagement.html:3
 msgid "Validate new users"
@@ -1335,7 +1349,7 @@
 
 #: ../../auth.c:605
 msgid "No users require validation at this time."
-msgstr "Právě nyvyžaduje potvrzení žádný uživatel."
+msgstr "Žádný uživatel právě nevyžaduje potvrzení."
 
 #: ../../auth.c:655
 msgid "very weak"
@@ -1380,11 +1394,11 @@
 
 #: ../../auth.c:830
 msgid "Cancelled.  Password was not changed."
-msgstr "Zrušeno, heslo se neuloží"
+msgstr "Zrušeno. Heslo se nezmění."
 
 #: ../../auth.c:839
 msgid "They don't match.  Password was not changed."
-msgstr "Obě hesla nesouhlasí, zůstává původní."
+msgstr "Hesla nesouhlasí. Heslo nezměněno."
 
 #: ../../auth.c:845
 msgid "Blank passwords are not allowed."
@@ -1435,7 +1449,7 @@
 
 #: ../../static/t/sieve/list.html:43
 msgid "Leave it in my inbox without filtering"
-msgstr "Zanechat v mé doručené poště bez filtování"
+msgstr "Zanechat v mé doručené poště bez filtrování"
 
 #: ../../static/t/sieve/list.html:44
 msgid "Filter it according to rules selected below"
@@ -1467,7 +1481,7 @@
 
 #: ../../static/t/sieve/display_one.html:21
 msgid "To or Cc"
-msgstr "Příjemce"
+msgstr "Příjemce nebo kopie"
 
 #: ../../static/t/sieve/display_one.html:23
 msgid "Reply-to"
@@ -1481,11 +1495,11 @@
 
 #: ../../static/t/sieve/display_one.html:25
 msgid "Resent-From"
-msgstr "Ignorovat z"
+msgstr "Přeposláno z"
 
 #: ../../static/t/sieve/display_one.html:26
 msgid "Resent-To"
-msgstr "Ignorovat zprávy k"
+msgstr "Přeposlat kam"
 
 #: ../../static/t/sieve/display_one.html:27
 msgid "Envelope From"
@@ -1558,7 +1572,7 @@
 
 #: ../../static/t/sieve/display_one.html:59
 msgid "bytes"
-msgstr ""
+msgstr "bajtů"
 
 #: ../../static/t/sieve/display_one.html:65
 msgid "Keep"
@@ -1566,7 +1580,7 @@
 
 #: ../../static/t/sieve/display_one.html:66
 msgid "Discard silently"
-msgstr "Tiše zlikvidovat"
+msgstr "Tiše zahodit"
 
 #: ../../static/t/sieve/display_one.html:67
 msgid "Reject"
@@ -1578,7 +1592,7 @@
 
 #: ../../static/t/sieve/display_one.html:69
 msgid "Forward to"
-msgstr "Přeposlat"
+msgstr "Přeposlat kam"
 
 #: ../../static/t/sieve/display_one.html:70
 msgid "Vacation"
@@ -1590,7 +1604,7 @@
 
 #: ../../static/t/sieve/display_one.html:90
 msgid "and then"
-msgstr "a tak"
+msgstr "potom"
 
 #: ../../static/t/sieve/display_one.html:93
 msgid "continue processing"
@@ -1606,8 +1620,9 @@
 "filtering.<br>Please contact your system administrator if you require this "
 "feature.<br>"
 msgstr ""
-"Tato instalace Citadely nepodporuje filtrování pošty na straně serveru."
-"<br>Pokud tuto funkci potřebujete, kontaktujte administrátora Vašeho systému."
+"Tato instalace Citadely nepodporuje filtrování pošty na straně "
+"serveru.<br>Pokud tuto funkci potřebujete, kontaktujte administrátora Vašeho "
+"systému."
 
 #: ../../static/t/sieve/add.html:9
 msgid "Add a new script"
@@ -1618,7 +1633,7 @@
 "To create a new script, enter the desired script name in the box below and "
 "click 'Create'."
 msgstr ""
-"Pro vytvoření skriptu napište požadované jméno a klikněte na ‚vytvořit‘."
+"Pro vytvoření skriptu napište požadované jméno a klikněte na 'vytvořit'."
 
 #: ../../static/t/sieve/add.html:14
 msgid "Script name: "
@@ -1642,7 +1657,7 @@
 "'Delete'."
 msgstr ""
 "Pro smazání existujících skriptů, vyberte jejich jména ze seznamu a klikněte "
-"na ‚Smazat‘"
+"na 'Smazat'"
 
 #: ../../static/t/msg/confirm_move.html:4
 msgid "Confirm move of message"
@@ -1654,7 +1669,7 @@
 
 #: ../../static/t/login.html:5
 msgid "powered by"
-msgstr ""
+msgstr "běží na"
 
 #: ../../static/t/login.html:15 ../../static/t/iconbar.html:88
 #: ../../static/t/get_logged_in.html:64 ../../static/t/get_logged_in.html:88
@@ -1684,132 +1699,135 @@
 
 #: ../../static/t/listsub/display.html:16
 msgid "You are subscribing "
-msgstr ""
+msgstr "Jste přihlášen "
 
 #: ../../static/t/listsub/display.html:17
-#, fuzzy
 msgid " to the "
-msgstr "na "
+msgstr " k "
 
 #: ../../static/t/listsub/display.html:18
-#, fuzzy
 msgid " mailing list."
-msgstr "Služba mailing seznamů"
+msgstr " poštovnímu seznamu."
 
 #: ../../static/t/listsub/display.html:19
 msgid ""
 "The listserver has sent you an e-mail with one additional Web link for you "
 "to click on to confirm your subscription."
 msgstr ""
+"Distribuční server Vám zaslal e-mail s webovým odkazem, kliknutím na něj "
+"potvrdíte vaše přihlášení."
 
 #: ../../static/t/listsub/display.html:20
 msgid ""
 "This extra step is for your protection, as it prevents others from being "
 "able to subscribe you to lists without your consent."
 msgstr ""
+"Tento krok navíc je pro vaši ochranu, aby vás ostatní nemohli přidat do "
+"seznamu bez vašeho souhlasu."
 
 #: ../../static/t/listsub/display.html:22
 msgid ""
 "Please click on the link which is being e-mailed to you and your "
 "subscription will be confirmed."
 msgstr ""
+"Prosím klikněte na odkaz, který vám byl zaslán pro potvrzení přihlášení."
 
 #: ../../static/t/listsub/display.html:27
 #: ../../static/t/listsub/display.html:47
-#, fuzzy
 msgid "ERROR"
-msgstr "CHYBA:"
+msgstr "CHYBA"
 
 #: ../../static/t/listsub/display.html:35
 msgid "You are unsubscribing"
-msgstr ""
+msgstr "Nejste přihlášen"
 
 #: ../../static/t/listsub/display.html:37
-#, fuzzy
 msgid "from the"
-msgstr "od "
+msgstr "od"
 
 #: ../../static/t/listsub/display.html:39
-#, fuzzy
 msgid "mailing list."
-msgstr "Služba mailing seznamů"
+msgstr "poštovní seznam"
 
 #: ../../static/t/listsub/display.html:40
 msgid ""
 "The listserver has sent you an e-mail with one additional Web link for you "
 "to click on to confirm your unsubscription."
 msgstr ""
+"Poštovní server vám poslal e-mail, který obsahuje odkaz na potvrzení vašeho "
+"odhlášení."
 
 #: ../../static/t/listsub/display.html:41
 msgid ""
 "This extra step is for your protection, as it prevents others from being "
 "able to unsubscribe you from lists without your consent."
 msgstr ""
+"Tento krok je pro vaši opchranu, aby vás ostatní nemohli odhlásit ze seznamu "
+"bez vašeho souhlasu."
 
 #: ../../static/t/listsub/display.html:43
 msgid ""
 "Please click on the link which is being e-mailed to you and your "
 "unsubscription will be confirmed."
 msgstr ""
+"Prosím klikněte na odkaz, který vám byl zaslám e-mailem k potvrzení vašeho "
+"odhlášení."
 
 #: ../../static/t/listsub/display.html:44
-#, fuzzy
 msgid "Back..."
-msgstr "Zpět"
+msgstr "Zpátky..."
 
 #: ../../static/t/listsub/display.html:54
-#, fuzzy
 msgid "Confirmation successful!"
-msgstr "Potvrzovací požadavek odeslán"
+msgstr "Přihlášení úspěšné!"
 
 #: ../../static/t/listsub/display.html:56
-#, fuzzy
 msgid "Confirmation failed."
-msgstr "Nastavení"
+msgstr "Přihlášení selhalo."
 
 #: ../../static/t/listsub/display.html:57
 msgid "This could mean one of two things:"
-msgstr ""
+msgstr "To může znamenat dvě věci:"
 
 #: ../../static/t/listsub/display.html:59
 msgid ""
 "You waited too long to confirm your subscribe/unsubscribe request (the "
 "confirmation link is only valid for three days)"
 msgstr ""
+"Čekáte příliš dlouho na potvrzení vašeho požadavku na přihlášení/odhlášení "
+"(potvrzující odkaz je funkční pouze tři dny)"
 
 #: ../../static/t/listsub/display.html:60
 msgid ""
 "You have <i>already</i> successfully confirmed your subscribe/unsubscribe "
 "request and are attempting to do it again."
 msgstr ""
+"Již \"jste\" úspěšně potvrdil přihlášovací/odhlášovací požadave a není nutné "
+"provádět znova."
 
 #: ../../static/t/listsub/display.html:62
 msgid "The error returned by the server was: "
-msgstr ""
+msgstr "Chyba vrácená serverem byla: "
 
 #: ../../static/t/listsub/display.html:70
-#, fuzzy
 msgid "Name of list:"
-msgstr "Název úlohy"
+msgstr "Název seznamu:"
 
 #: ../../static/t/listsub/display.html:75
-#, fuzzy
 msgid "Your e-mail address:"
-msgstr "Preferovaná e-mailová adresa"
+msgstr "Vaše e-mailová adresa:"
 
 #: ../../static/t/listsub/display.html:79
 msgid "(If subscribing) preferred format: "
-msgstr ""
+msgstr "(Pokud jste přihlášen) preferovaný formát: "
 
 #: ../../static/t/listsub/display.html:80
-#, fuzzy
 msgid "One message at a time"
-msgstr "Zadejte text zprávy:"
+msgstr "Jedna zpráva v čase"
 
 #: ../../static/t/listsub/display.html:81
-#, fuzzy
 msgid "Digest format"
-msgstr "Formát času"
+msgstr "Vybraný formát"
 
 #: ../../static/t/listsub/display.html:89
 msgid ""
@@ -1817,20 +1835,24 @@
 "receive an e-mail containing one additional web link to click on for final "
 "confirmation."
 msgstr ""
+"Při pokusu o přihlášení/odhlášení z poštovního seznamu přijmete e-mail "
+"obsahující webový odkaz potřebný ke konečnému potvrzení."
 
 #: ../../static/t/listsub/display.html:90
 msgid ""
 "This extra step is for your protection, as it prevents others from being "
 "able to subscribe or unsubscribe you to lists."
 msgstr ""
+"Tento krok je pro vaši ochranu, brání ostatním uživatelům aby vás mohli "
+"přihlásit nebo odhlásit z poštovního seznamu."
 
 #: ../../static/t/floors_edit_one.html:11
 msgid "(delete floor)"
-msgstr ""
+msgstr "(odstranit podlaží)"
 
 #: ../../static/t/floors_edit_one.html:13
 msgid "(edit graphic)"
-msgstr "(upravit vzhled)"
+msgstr "(upravit obrázek)"
 
 #: ../../static/t/floors.html:4
 msgid "Add/change/delete floors"
@@ -1838,11 +1860,11 @@
 
 #: ../../static/t/floors.html:10
 msgid "Floor number"
-msgstr ""
+msgstr "Číslo podlaží"
 
 #: ../../static/t/floors.html:11
 msgid "Floor name"
-msgstr ""
+msgstr "Jméno podlaží"
 
 #: ../../static/t/floors.html:12
 msgid "Number of rooms"
@@ -1850,11 +1872,11 @@
 
 #: ../../static/t/floors.html:13
 msgid "Floor CSS"
-msgstr ""
+msgstr "CSS úrovně"
 
 #: ../../static/t/files.html:4
 msgid "Files available for download in"
-msgstr "Soubory dostupné pro stažení z"
+msgstr "Soubory dostupné pro stažení v"
 
 #: ../../static/t/files.html:9
 msgid "Upload a file:"
@@ -1928,7 +1950,7 @@
 
 #: ../../static/t/edit_message.html:118
 msgid "Save to Drafts"
-msgstr "Uložit do Koncetptů"
+msgstr "Uložit do Konceptů"
 
 #: ../../static/t/edit_message.html:126
 #: ../../static/t/edit_message/attachments_pane.html:5
@@ -1958,7 +1980,7 @@
 #: ../../static/t/aide/display_sitewide_config.html:6
 #: ../../static/t/aide/edituser/select.html:9
 msgid "You need to be aide to view this."
-msgstr ""
+msgstr "Musíte být Aide pro zobrazení tohoto."
 
 #: ../../static/t/aide/display_sitewide_config.html:11
 msgid "General"
@@ -1970,11 +1992,11 @@
 
 #: ../../static/t/aide/display_sitewide_config.html:13
 msgid "Network"
-msgstr ""
+msgstr "Síť"
 
 #: ../../static/t/aide/display_sitewide_config.html:14
 msgid "Tuning"
-msgstr ""
+msgstr "Ladění"
 
 #: ../../static/t/aide/display_sitewide_config.html:15
 msgid "Directory"
@@ -1982,24 +2004,24 @@
 
 #: ../../static/t/aide/display_sitewide_config.html:16
 msgid "Auto-purger"
-msgstr ""
+msgstr "Automatické čištění"
 
 #: ../../static/t/aide/display_sitewide_config.html:17
 msgid "Indexing/Journaling"
-msgstr "Indexování/žurnálování"
+msgstr "Indexování/žurnálovaní"
 
 #: ../../static/t/aide/display_sitewide_config.html:18
 #: ../../static/t/aide/siteconfig/tab_pushmail.html:1
 msgid "Push Email"
-msgstr ""
+msgstr "Odeslat Email"
 
 #: ../../static/t/aide/display_sitewide_config.html:19
 msgid "Pop3"
-msgstr ""
+msgstr "Pop3"
 
 #: ../../static/t/aide/usermanagement.html:2
 msgid "Add, change, delete user accounts"
-msgstr "Přidat, upravit, vymazat uživatelské účty"
+msgstr "Přidat, upravit nebo vymazat uživatelské účty"
 
 #: ../../static/t/aide/display_inetconf.html:5
 #: ../../static/t/aide/display_menu.html:5
@@ -2009,15 +2031,15 @@
 #: ../../static/t/aide/display_inetconf.html:6
 #: ../../static/t/aide/display_menu.html:6
 msgid "Room Aide Menu"
-msgstr ""
+msgstr "Menu poradce pro pokoj"
 
 #: ../../static/t/aide/display_inetconf.html:13
 msgid "Local host aliases"
-msgstr ""
+msgstr "Lokální alias klienta"
 
 #: ../../static/t/aide/display_inetconf.html:14
 msgid "Directory domains"
-msgstr ""
+msgstr "Adresář domén"
 
 #: ../../static/t/aide/display_inetconf.html:15
 msgid "Smart hosts"
@@ -2029,7 +2051,7 @@
 
 #: ../../static/t/aide/display_inetconf.html:17
 msgid "Notification hosts"
-msgstr ""
+msgstr "Oznámení hostů"
 
 #: ../../static/t/aide/display_inetconf.html:22
 msgid "RBL hosts"
@@ -2090,7 +2112,7 @@
 
 #: ../../static/t/aide/edituser/detailview.html:40
 msgid "Access level"
-msgstr ""
+msgstr "Úroveň přístupu"
 
 #: ../../static/t/aide/edituser/detailview.html:54
 msgid "User ID number"
@@ -2102,7 +2124,7 @@
 
 #: ../../static/t/aide/edituser/detailview.html:68
 msgid "Auto-purge after this many days"
-msgstr ""
+msgstr "Automaticky vymazat po dnech"
 
 #: ../../static/t/aide/edituser/add.html:1
 msgid ""
@@ -2136,7 +2158,7 @@
 
 #: ../../static/t/aide/display_generic_cmd.html:17
 msgid "Command input (if requesting SEND_LISTING transfer mode):"
-msgstr ""
+msgstr "Vstupní příkaz (pokud požaduje SEND_LISTING přenosový mód):"
 
 #: ../../static/t/aide/display_generic_cmd.html:20
 msgid "Detected host header is "
@@ -2162,7 +2184,7 @@
 
 #: ../../static/t/aide/floorconfig.html:2
 msgid "Add, change, or delete floors"
-msgstr "Přidat, upravit nebo odstranit úroveň"
+msgstr "Přidat, upravit nebo odstranit podlaží"
 
 #: ../../static/t/aide/serverrestart/box.html:3
 msgid "Please wait while the Citadel server is restarted... "
@@ -2173,6 +2195,8 @@
 "Please wait while your users are being paged, the citadel server will be "
 "restarted after that... "
 msgstr ""
+"Prosím počkejte dokud nebudou uživatelé nastránkováni, citadel server se "
+"poté restartuje. "
 
 #: ../../static/t/aide/inet/masqdomains.html:2
 msgid "(Domains as which users are allowed to masquerade)"
@@ -2184,14 +2208,15 @@
 
 #: ../../static/t/aide/inet/dirnames.html:2
 msgid "(domains mapped with the Global Address Book)"
-msgstr ""
+msgstr "(domény uvedené v Globálním Adresáři)"
 
 #: ../../static/t/aide/inet/notify.html:2
 msgid "(URLS for notifications when users receive new mails; )"
-msgstr ""
+msgstr "(URLS pro oznámení, když uživatel dostane nový email; )"
 
 #: ../../static/t/aide/inet/notify.html:2
-msgid "Syntax: Notificationtemplatename:http[s]://user:password@hostname/path"
+msgid ""
+"Syntax: Notificationtemplatename:http[s]://user:password@hostname/path"
 msgstr ""
 
 #: ../../static/t/aide/inet/smarthosts.html:2
@@ -2200,19 +2225,20 @@
 
 #: ../../static/t/aide/inet/aliases.html:2
 msgid "(domains for which this host receives mail)"
-msgstr ""
+msgstr "(domény, ze kterých tento host přijímá emaily)"
 
 #: ../../static/t/aide/inet/clamav.html:2
 msgid "(hosts running the ClamAV clamd service)"
-msgstr ""
+msgstr "(hosti využívající ClamAV clamd službu)"
 
 #: ../../static/t/aide/inet/spamass.html:2
 msgid "(hosts running the SpamAssassin service)"
-msgstr ""
+msgstr "(hosti využívající SpamAssassin službu)"
 
 #: ../../static/t/aide/inet/fallbackhosts.html:2
 msgid "(send outbound mail to these hosts only when direct delivery fails)"
 msgstr ""
+"(zasílání odchozích mailů na tyto hosty pouze, pokud přímé doručení selže)"
 
 #: ../../static/t/aide/ignetconf/display_confirm_delete.html:5
 msgid "Confirm delete"
@@ -2253,7 +2279,7 @@
 #: ../../static/t/aide/ignetconf/edit_node.html:17
 #: ../../static/t/aide/ignetconf/add.html:17
 msgid "Shared secret"
-msgstr "Sdílené tajemství"
+msgstr "Sdílené heslo"
 
 #: ../../static/t/aide/ignetconf/edit_node.html:19
 #: ../../static/t/aide/ignetconf/add.html:19
@@ -2267,7 +2293,7 @@
 
 #: ../../static/t/aide/ignetconf/section.html:4
 msgid "(Edit)"
-msgstr "(upravit)"
+msgstr "(Upravit)"
 
 #: ../../static/t/aide/display_menu.html:12
 msgid "Global Configuration"
@@ -2287,11 +2313,11 @@
 
 #: ../../static/t/aide/global_config.html:2
 msgid "Edit site-wide configuration"
-msgstr "Upravte nastavení"
+msgstr "Upravit nastavení"
 
 #: ../../static/t/aide/global_config.html:3
 msgid "Domain names and Internet mail configuration"
-msgstr "Doménová jména a nastavení Inertnetových zpráv"
+msgstr "Doménová jména a nastavení Internetových e-mailů"
 
 #: ../../static/t/aide/global_config.html:4
 msgid "Configure replication with other Citadel servers"
@@ -2308,7 +2334,7 @@
 
 #: ../../static/t/aide/restart.html:3
 msgid "Restart after paging users"
-msgstr ""
+msgstr "Restartovat after paging users"
 
 #: ../../static/t/aide/restart.html:4
 msgid "Restart when all users are idle"
@@ -2316,7 +2342,7 @@
 
 #: ../../static/t/aide/siteconfig/tab_general.html:1
 msgid "General site configuration items"
-msgstr ""
+msgstr "Obecné nastavení služby"
 
 #: ../../static/t/aide/siteconfig/tab_general.html:5
 msgid "Change Login Logo"
@@ -2328,11 +2354,11 @@
 
 #: ../../static/t/aide/siteconfig/tab_general.html:11
 msgid "Fully qualified domain name"
-msgstr ""
+msgstr "Plně kvalifikované doménové jméno"
 
 #: ../../static/t/aide/siteconfig/tab_general.html:14
 msgid "Human-readable node name"
-msgstr ""
+msgstr "Člověku čitelný název nodu"
 
 #: ../../static/t/aide/siteconfig/tab_general.html:17
 msgid "Telephone number"
@@ -2356,33 +2382,34 @@
 
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:1
 msgid "Configure automatic expiry of old messages"
-msgstr ""
+msgstr "Automatické nastavení vypršení starých zpráv"
 
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:2
 msgid "These settings may be overridden on a per-floor or per-room basis."
 msgstr ""
+"Toto nastavení může být změněno na úrovni nastavení podlaží nebo místností."
 
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:6
 msgid "Hour to run database auto-purge"
-msgstr ""
+msgstr "Hodina ke spuštění automatického čištění databáze."
 
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:66
 msgid "Default message expire policy for public rooms"
-msgstr ""
+msgstr "Výchozí pravidlo pro zprávy o vypršeníl ve veřejných místnostech"
 
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:68
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:86
 #: ../../static/t/room/edit/tab_expire.html:17
 #: ../../static/t/room/edit/tab_expire.html:45
 msgid "Never automatically expire messages"
-msgstr ""
+msgstr "Nikdy nevymazávat prošlé zprávy"
 
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:71
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:89
 #: ../../static/t/room/edit/tab_expire.html:20
 #: ../../static/t/room/edit/tab_expire.html:48
 msgid "Expire by message count"
-msgstr ""
+msgstr "Zprávy vyprší počtem"
 
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:73
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:92
@@ -2400,11 +2427,11 @@
 
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:81
 msgid "Default message expire policy for private mailboxes"
-msgstr ""
+msgstr "Výchozí pravidlo prošlých zpráv pro soukromé složky"
 
 #: ../../static/t/aide/siteconfig/tab_autopurger.html:83
 msgid "Same policy as public rooms"
-msgstr ""
+msgstr "Stejné pravidla jako veřejné místnosti"
 
 #: ../../static/t/aide/siteconfig/tab_network.html:1
 msgid "Network services"
@@ -2433,7 +2460,7 @@
 
 #: ../../static/t/aide/siteconfig/tab_network.html:15
 msgid "IMAP listener port (-1 to disable)"
-msgstr ""
+msgstr "IMAP naslouchací port (-1 pro vypnutí)"
 
 #: ../../static/t/aide/siteconfig/tab_network.html:19
 msgid "Network run frequency (in seconds)"
@@ -2445,7 +2472,7 @@
 
 #: ../../static/t/aide/siteconfig/tab_network.html:25
 msgid "SMTP MSA port (-1 to disable)"
-msgstr ""
+msgstr "SMTP MSA port (-1 pro vypnutí)"
 
 #: ../../static/t/aide/siteconfig/tab_network.html:28
 msgid "IMAP over SSL port (-1 to disable)"
@@ -2493,15 +2520,15 @@
 
 #: ../../static/t/aide/siteconfig/tab_pop3.html:1
 msgid "POP3"
-msgstr ""
+msgstr "POP3"
 
 #: ../../static/t/aide/siteconfig/tab_pop3.html:6
 msgid "POP3 listener port (-1 to disable)"
-msgstr ""
+msgstr "POP3 naslouchací port (-1 pro vypnutí)"
 
 #: ../../static/t/aide/siteconfig/tab_pop3.html:9
 msgid "POP3 over SSL port (-1 to disable)"
-msgstr ""
+msgstr "POP3 přes SSL port (-1 pro vypnutí)"
 
 #: ../../static/t/aide/siteconfig/tab_pop3.html:12
 msgid "POP3 fetch frequency in seconds"
@@ -2517,7 +2544,7 @@
 
 #: ../../static/t/aide/siteconfig/tab_tuning.html:5
 msgid "Server connection idle timeout (in seconds)"
-msgstr ""
+msgstr "Spojení se serverem v nečinnosti - timeout (sekundy)"
 
 #: ../../static/t/aide/siteconfig/tab_tuning.html:8
 msgid "Maximum concurrent sessions (0 = no limit)"
@@ -2529,7 +2556,7 @@
 
 #: ../../static/t/aide/siteconfig/tab_tuning.html:14
 msgid "Default room purge time (days)"
-msgstr ""
+msgstr "Výchozí čas pro vyčištění místnosti (dny)"
 
 #: ../../static/t/aide/siteconfig/tab_tuning.html:17
 msgid "Maximum message length"
@@ -2537,35 +2564,35 @@
 
 #: ../../static/t/aide/siteconfig/tab_tuning.html:20
 msgid "Minimum number of worker threads"
-msgstr ""
+msgstr "Minimální počet pracovních vláken"
 
 #: ../../static/t/aide/siteconfig/tab_tuning.html:23
 msgid "Maximum number of worker threads"
-msgstr ""
+msgstr "Maximální počet pracovních vláken"
 
 #: ../../static/t/aide/siteconfig/tab_tuning.html:26
 msgid "Automatically delete committed database logs"
-msgstr ""
+msgstr "Automaticky smazat odeslaný databázový záznam"
 
 #: ../../static/t/aide/siteconfig/tab_pushmail.html:5
 msgid "Funambol server host (blank to disable)"
-msgstr ""
+msgstr "Hostitelský server Funambol (prázdné pole pro vypnutí)"
 
 #: ../../static/t/aide/siteconfig/tab_pushmail.html:8
 msgid "Funambol server port "
-msgstr ""
+msgstr "Port serveru Funambol. "
 
 #: ../../static/t/aide/siteconfig/tab_pushmail.html:11
 msgid "Funambol sync source"
-msgstr ""
+msgstr "Funambol sync zdroje"
 
 #: ../../static/t/aide/siteconfig/tab_pushmail.html:14
 msgid "Funambol auth details (user:pass)"
-msgstr ""
+msgstr "Funambol autorizační detaily (uživatel:heslo)"
 
 #: ../../static/t/aide/siteconfig/tab_pushmail.html:17
 msgid "External pager tool (blank to disable)"
-msgstr ""
+msgstr "Externí pager nástroje (prázdné pole pro vypnutí)"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:1
 msgid "Access controls and site policy settings"
@@ -2577,19 +2604,19 @@
 
 #: ../../static/t/aide/siteconfig/tab_access.html:9
 msgid "Quarantine messages from problem users"
-msgstr ""
+msgstr "Karanténí zprávy pro problémové uživatele"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:12
 msgid "Name of quarantine room"
-msgstr ""
+msgstr "Jméno karanténí místnosti"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:17
 msgid "Name of room to log pages"
-msgstr ""
+msgstr "Jméno místnosti pro stránky s logy"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:22
 msgid "Authentication mode"
-msgstr ""
+msgstr "Ověřovací mód"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:24
 msgid "Self contained"
@@ -2609,22 +2636,23 @@
 
 #: ../../static/t/aide/siteconfig/tab_access.html:30
 msgid "Master user name (blank to disable)"
-msgstr ""
+msgstr "Administrátorské jméno"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:33
 msgid "Master user password"
-msgstr ""
+msgstr "Administrátorské heslo"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:38
 msgid "Initial access level for new users"
-msgstr ""
+msgstr "Počáteční úroveň přístupu pro nové uživatele"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:49
 msgid "Access level required to create rooms"
-msgstr ""
+msgstr "Potřebné oprávnění pro vytváření nových místností"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:60
-msgid "Automatically grant room-aide status to users who create private rooms"
+msgid ""
+"Automatically grant room-aide status to users who create private rooms"
 msgstr ""
 
 #: ../../static/t/aide/siteconfig/tab_access.html:63
@@ -2633,11 +2661,11 @@
 
 #: ../../static/t/aide/siteconfig/tab_access.html:66
 msgid "Restrict access to Internet mail"
-msgstr ""
+msgstr "Zakázat přístup k Internetovému e-mailu"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:71
 msgid "Disable self-service user account creation"
-msgstr ""
+msgstr "Zakázat vlastní vytvoření uživatele"
 
 #: ../../static/t/aide/siteconfig/tab_access.html:71
 msgid "Hint: do not select both!"
@@ -2649,19 +2677,19 @@
 
 #: ../../static/t/aide/siteconfig/tab_access.html:77
 msgid "Allow anonymous guest access"
-msgstr ""
+msgstr "Povolit anonymní přístup"
 
 #: ../../static/t/aide/siteconfig/tab_indexing.html:1
 msgid "Indexing and Journaling"
-msgstr ""
+msgstr "Indexování a Žurnálování"
 
 #: ../../static/t/aide/siteconfig/tab_indexing.html:2
 msgid "Warning: these facilities are resource intensive."
-msgstr ""
+msgstr "Varování: tyto možnosti jsou systémově náročné."
 
 #: ../../static/t/aide/siteconfig/tab_indexing.html:6
 msgid "Enable full text index"
-msgstr ""
+msgstr "Aktivovat full-textové indexování"
 
 #: ../../static/t/aide/siteconfig/tab_indexing.html:9
 msgid "Perform journaling of email messages"
@@ -2677,21 +2705,23 @@
 
 #: ../../static/t/aide/siteconfig/tab_directory.html:1
 msgid "Configure the LDAP connector for Citadel"
-msgstr ""
+msgstr "Nastavení LDAP konektoru pro Citadel"
 
 #: ../../static/t/aide/siteconfig/tab_directory.html:4
 msgid ""
 "NOTE: This Citadel server has been built without LDAP support.  These "
 "options will have no effect."
 msgstr ""
+"Poznámka: Tento Citadel server byl postaven bez podpory LDAP. Toto nastavení "
+"nebude mít vliv."
 
 #: ../../static/t/aide/siteconfig/tab_directory.html:9
 msgid "Host name of LDAP server (blank to disable)"
-msgstr ""
+msgstr "Název hosta LDAP serveru (nechte prázdné pro vypnutí)"
 
 #: ../../static/t/aide/siteconfig/tab_directory.html:13
 msgid "Port number of LDAP server (blank to disable)"
-msgstr ""
+msgstr "Číslo portu LDAP serveru (prázdné pole pro vypnutí)"
 
 #: ../../static/t/aide/siteconfig/tab_directory.html:16
 msgid "Base DN"
@@ -2784,11 +2814,11 @@
 
 #: ../../static/t/openid_manual_create.html:3
 msgid "conflicts with an existing user."
-msgstr "používá jiný uživatel."
+msgstr "je v konfliktu s existujícím uživatelem."
 
 #: ../../static/t/openid_manual_create.html:5
 msgid "Please specify the user name you would like to use."
-msgstr ""
+msgstr "Prosím specifikujte uživatele, kterého použít."
 
 #: ../../static/t/files/graphicsupload.html:2
 msgid "Image upload"
@@ -2808,7 +2838,7 @@
 
 #: ../../static/t/roombanner.html:10 ../../static/t/roombanner.html:11
 msgid "new of"
-msgstr ""
+msgstr "nový z"
 
 #: ../../static/t/roombanner.html:10 ../../static/t/roombanner.html:11
 #: ../../static/t/msg_listselector_bottom.html:7
@@ -2840,12 +2870,12 @@
 #: ../../static/t/msg_listselector_bottom.html:12
 #: ../../static/t/msg_listselector_top.html:12
 msgid "oldest to newest"
-msgstr ""
+msgstr "nejstařší po nejnovější"
 
 #: ../../static/t/msg_listselector_bottom.html:20
 #: ../../static/t/msg_listselector_top.html:20
 msgid "newest to oldest"
-msgstr ""
+msgstr "nejnovější po nejstarší"
 
 #: ../../static/t/newstartpage.html:4
 msgid "New start page"
@@ -2873,7 +2903,7 @@
 
 #: ../../static/t/prefs/pushemail.html:2
 msgid "Configure Push Email"
-msgstr "Nastavit push email"
+msgstr "Nastavit Push Email"
 
 #: ../../static/t/prefs/pushemail.html:9
 msgid "Push email and SMS settings"
@@ -2951,7 +2981,7 @@
 
 #: ../../static/t/prefs/box.html:238
 msgid "Full-functionality"
-msgstr ""
+msgstr "Plná funkcionalita"
 
 #: ../../static/t/prefs/box.html:241
 msgid "Safe mode"
@@ -3174,7 +3204,8 @@
 
 #: ../../static/t/iconbar/edit.html:73
 msgid "Clicking this icon displays a list of all users currently logged in."
-msgstr "Kliknutím na tuto ikonu zobrazíte seznam všech přihlášených uživatelů."
+msgstr ""
+"Kliknutím na tuto ikonu zobrazíte seznam všech přihlášených uživatelů."
 
 #: ../../static/t/iconbar/edit.html:79
 msgid ""
@@ -3194,7 +3225,7 @@
 
 #: ../../static/t/iconbar/edit.html:91
 msgid "Citadel logo"
-msgstr ""
+msgstr "Citadel logo"
 
 #: ../../static/t/iconbar/edit.html:91
 msgid "Displays the 'Powered by Citadel' icon"
@@ -3238,7 +3269,7 @@
 
 #: ../../static/t/room/edit/editroom.html:10 ../../static/t/room/edit.html:11
 msgid "Remote retrieval"
-msgstr ""
+msgstr "Vzdálené stažení"
 
 #: ../../static/t/room/edit/tab_config.html:6
 msgid "name of room: "
@@ -3341,7 +3372,7 @@
 
 #: ../../static/t/room/edit/tab_config.html:132
 msgid "Prompt user when entering messages"
-msgstr ""
+msgstr "Vyzvat uživatele při psaní zpráv"
 
 #: ../../static/t/room/edit/tab_config.html:136
 msgid "Room aide: "
@@ -3360,6 +3391,8 @@
 "<i>The contents of this room are being mailed <b>in digest form</b> to the "
 "following list recipients:</i><br><br>"
 msgstr ""
+"<i>Obsah této místnosti je odesílán <b>ve formě digest</b> na následující "
+"seznam příjemců:</i><br><br>"
 
 #: ../../static/t/room/edit/tab_listserv.html:39
 msgid "Add recipients from Contacts or other address books"
@@ -3437,7 +3470,8 @@
 msgid ""
 "Retrieve messages from these remote POP3 accounts and store them in this "
 "room:"
-msgstr "Stáhnout zprávy ze vzdáleného POP3 servru a ulož je v této místnosti:"
+msgstr ""
+"Stáhnout zprávy ze vzdáleného POP3 servru a ulož je v této místnosti:"
 
 #: ../../static/t/room/edit/tab_feed.html:12
 msgid "Remote host"
@@ -3489,7 +3523,7 @@
 
 #: ../../static/t/room/zapped_list.html:10
 msgid "Click on any room to un-zap it and goto that room."
-msgstr ""
+msgstr "Klikněte na místnost pro obnovení a vstup do této místnosti."
 
 #: ../../static/t/room/display_private.html:7
 msgid "Go to a hidden room"
@@ -3617,7 +3651,7 @@
 
 #: ../../static/t/menu/basic_commands.html:12
 msgid "(post in this room)"
-msgstr ""
+msgstr "(posláno v této místnosti)"
 
 #: ../../static/t/menu/basic_commands.html:13
 msgid "File library"
@@ -3645,7 +3679,7 @@
 
 #: ../../static/t/menu/basic_commands.html:19
 msgid "Bye!"
-msgstr "Nashledanou!"
+msgstr "Mějte se!"
 
 #: ../../static/t/menu/advanced_roomcommands.html:3
 msgid "Edit or delete this room"
@@ -3713,7 +3747,7 @@
 
 #: ../../static/t/navbar.html:132
 msgid "Wiki home"
-msgstr ""
+msgstr "Wiki"
 
 #: ../../static/t/navbar.html:139
 msgid "Edit this page"
@@ -3733,7 +3767,7 @@
 
 #: ../../static/t/msg_listview.html:18
 msgid "Loading messages from server, please wait"
-msgstr "Načítám zprávy ze servru, prosím čekejte"
+msgstr "Načítám zprávy ze serveru, prosím čekejte"
 
 #: ../../static/t/msg_listview.html:24
 msgid "Open in new window"
@@ -3745,7 +3779,7 @@
 
 #: ../../static/t/view_mailq/message.html:6
 msgid "Originaly posted in: "
-msgstr ""
+msgstr "Originálně zasláno v "
 
 #: ../../static/t/view_mailq/header.html:15
 msgid "Refresh this page"
@@ -3760,9 +3794,8 @@
 msgstr "Datum a čas poslání"
 
 #: ../../static/t/view_mailq/header.html:25
-#, fuzzy
 msgid "Next attempt"
-msgstr "Poslední pokus"
+msgstr "Další pokus"
 
 #: ../../static/t/view_mailq/header.html:29
 msgid "Recipients"
@@ -3812,19 +3845,16 @@
 msgstr "OpenID URL:"
 
 #: ../../static/t/get_logged_in.html:92
-#, fuzzy
 msgid "Log in using Google"
-msgstr "Přihlašte se s pomocí OpenID"
+msgstr "Přihlásit se použitím Google"
 
 #: ../../static/t/get_logged_in.html:97
-#, fuzzy
 msgid "Log in using Yahoo"
-msgstr "Přihlašte se s pomocí OpenID"
+msgstr "Přihlásit se použitím Yahoo"
 
 #: ../../static/t/get_logged_in.html:102
-#, fuzzy
 msgid "Log in using AOL or AIM"
-msgstr "Přihlašte se s pomocí OpenID"
+msgstr "Přihlásit použitím AOL nebo AIM"
 
 #: ../../static/t/get_logged_in.html:104
 msgid "Enter your AOL or AIM screen name:"
@@ -3848,7 +3878,7 @@
 
 #: ../../static/t/summary/page.html:51
 msgid "Who‘s&nbsp;online&nbsp;now"
-msgstr "Kdo je online &nbsp;online&nbsp;now"
+msgstr "Kdo je nyní &nbsp;online&nbsp;"
 
 #: ../../static/t/summary/page.html:60
 msgid "About&nbsp;this&nbsp;server"
@@ -3897,31 +3927,3 @@
 #: ../../static/t/loggedinas.html:6
 msgid "Not logged in."
 msgstr "Nepřihlášen."
-
-#~ msgid "A script by that name already exists."
-#~ msgstr "Skript s tímto jménem již existuje."
-
-#~ msgid ""
-#~ "A new script has been created.  Return to the script editing screen to "
-#~ "edit and activate it."
-#~ msgstr ""
-#~ "Nový skript byl úspěšně vytvořen. Vraťte se na editaci skriptů a "
-#~ "aktivujte jej."
-
-#~ msgid "Create"
-#~ msgstr "Vytvořit"
-
-#~ msgid "Delete script"
-#~ msgstr "Smazat skript"
-
-#~ msgid "Delete this script?"
-#~ msgstr "Skutečně chcete smazat tento skript?"
-
-#~ msgid "Move rule up"
-#~ msgstr "Posunout pravidlo výše"
-
-#~ msgid "Move rule down"
-#~ msgstr "Posunout pravidlo níže"
-
-#~ msgid "Delete rule"
-#~ msgstr "Smazat pravidlo"
diff -Nru webcit-8.11-dfsg/po/webcit/it.po webcit-8.12-dfsg/po/webcit/it.po
--- webcit-8.11-dfsg/po/webcit/it.po	2012-05-22 17:14:47.000000000 +0200
+++ webcit-8.12-dfsg/po/webcit/it.po	2012-06-26 17:56:25.000000000 +0200
@@ -18,6 +18,11 @@
 "X-Launchpad-Export-Date: 2010-11-14 05:02+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
+#: ../../messages.c:1719
+#, c-format
+msgid "An error occurred while retrieving this part: %s/%s\n"
+msgstr "E' avvenuto un errore durante il recupero di questa parte: %s/%s\n"
+
 #: ../../roomops.c:708 ../../roomops.c:1005 ../../sieve.c:364
 msgid "Cancelled.  Changes were not saved."
 msgstr "Attività Cancellata.Le modifiche non sono state salvate."
@@ -1057,11 +1062,6 @@
 msgid "The message was not moved."
 msgstr "Il messaggio non è stato spostato"
 
-#: ../../messages.c:1719
-#, c-format
-msgid "An error occurred while retrieving this part: %s/%s\n"
-msgstr "E' avvenuto un errore durante il recupero di questa parte: %s/%s\n"
-
 #: ../../messages.c:1796
 #, c-format
 msgid "An error occurred while retrieving this part: %s\n"
diff -Nru webcit-8.11-dfsg/tcp_sockets.c webcit-8.12-dfsg/tcp_sockets.c
--- webcit-8.11-dfsg/tcp_sockets.c	2012-05-22 17:14:47.000000000 +0200
+++ webcit-8.12-dfsg/tcp_sockets.c	2012-06-26 17:56:25.000000000 +0200
@@ -396,13 +396,14 @@
 	wcsession *WCC = WC;
 	size_t bytes_read = 0;
 	size_t this_block = 0;
-	int rc;
+	int rc = 6;
+	int ServerRc = 6;
 
 	if (Ret == NULL) {
 		return -1;
 	}
 
-	while (bytes_read < total_len) {
+	while ((bytes_read < total_len) && (ServerRc == 6)) {
 
 		if (WCC->serv_sock==-1) {
 			FlushStrBuf(Ret); 
@@ -410,7 +411,8 @@
 		}
 
 		serv_printf("READ "SIZE_T_FMT"|"SIZE_T_FMT, bytes_read, total_len-bytes_read);
-		if ( (rc = StrBuf_ServGetln(Buf) > 0) && (GetServerStatus(Buf, NULL) == 6) ) 
+		if ( (rc = StrBuf_ServGetln(Buf) > 0) &&
+		     (ServerRc = GetServerStatus(Buf, NULL), ServerRc == 6) ) 
 		{
 			if (rc < 0)
 				return rc;
diff -Nru webcit-8.11-dfsg/webcit.h webcit-8.12-dfsg/webcit.h
--- webcit-8.11-dfsg/webcit.h	2012-05-22 17:14:47.000000000 +0200
+++ webcit-8.12-dfsg/webcit.h	2012-06-26 17:56:25.000000000 +0200
@@ -128,9 +128,9 @@
 #define PORT_NUM		2000		/* port number to listen on */
 #define DEVELOPER_ID		0
 #define CLIENT_ID		4
-#define CLIENT_VERSION		811		/* This version of WebCit */
-#define MINIMUM_CIT_VERSION	811		/* Minimum required version of Citadel server */
-#define	LIBCITADEL_MIN		811		/* Minimum required version of libcitadel */
+#define CLIENT_VERSION		812		/* This version of WebCit */
+#define MINIMUM_CIT_VERSION	812		/* Minimum required version of Citadel server */
+#define	LIBCITADEL_MIN		812		/* Minimum required version of libcitadel */
 #define DEFAULT_HOST		"localhost"	/* Default Citadel server */
 #define DEFAULT_PORT		"504"
 #define TARGET			"webcit01"	/* Window target for inline URL's */

Reply to: