From a4f0e3fbc3ff6e65601cf305b952199172387ba3 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sat, 2 Jul 2011 21:10:16 +0000 Subject: [PATCH] Templatize sieve rules editor; return success/fail state of serverwrite - return status of sending stuff to citserver, so we can abort loops in time if our connection dies. - add sieve scripts lists with content to the session for one request - add hooks for listing sieve scripts and their contents - add parser for our webcit embedded sieve editor - add hooks for our webcit embedded sieve editor - add templates with the contents from sieve.c --- webcit/config.guess | 219 ++-- webcit/config.sub | 156 ++- webcit/sieve.c | 1108 ++++++++++++----- webcit/static/t/sieve/add.html | 32 + webcit/static/t/sieve/display.html | 123 ++ webcit/static/t/sieve/display_one.html | 100 ++ webcit/static/t/sieve/display_one_script.html | 3 + webcit/static/t/sieve/empty.html | 0 webcit/static/t/sieve/list.html | 85 ++ webcit/static/t/sieve/list_select_one.html | 1 + webcit/static/t/sieve/none.html | 14 + webcit/static/t/sieve/roomlist.html | 1 + webcit/static/t/sieve/script_select.html | 1 + webcit/subst.c | 2 + webcit/subst.h | 6 +- webcit/tcp_sockets.c | 29 +- webcit/webcit.h | 15 +- 17 files changed, 1407 insertions(+), 488 deletions(-) create mode 100644 webcit/static/t/sieve/add.html create mode 100644 webcit/static/t/sieve/display.html create mode 100644 webcit/static/t/sieve/display_one.html create mode 100644 webcit/static/t/sieve/display_one_script.html create mode 100644 webcit/static/t/sieve/empty.html create mode 100644 webcit/static/t/sieve/list.html create mode 100644 webcit/static/t/sieve/list_select_one.html create mode 100644 webcit/static/t/sieve/none.html create mode 100644 webcit/static/t/sieve/roomlist.html create mode 100644 webcit/static/t/sieve/script_select.html diff --git a/webcit/config.guess b/webcit/config.guess index c2246a4f7..40eaed482 100755 --- a/webcit/config.guess +++ b/webcit/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2009-12-30' +timestamp='2011-05-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -181,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -224,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -270,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -296,7 +299,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -395,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -481,8 +484,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -495,7 +498,7 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -552,7 +555,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -595,52 +598,52 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include - #include + #define _HPUX_SOURCE + #include + #include - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -731,22 +734,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -770,14 +773,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -805,14 +808,14 @@ EOF echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -867,7 +870,7 @@ EOF EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -879,7 +882,13 @@ EOF then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) @@ -892,7 +901,7 @@ EOF echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -960,7 +969,7 @@ EOF echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -968,6 +977,9 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-tilera-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; @@ -975,7 +987,7 @@ EOF echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -984,11 +996,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1020,7 +1032,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1048,13 +1060,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1089,8 +1101,8 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1133,10 +1145,10 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1162,11 +1174,11 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1231,6 +1243,9 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1276,13 +1291,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1322,11 +1337,11 @@ main () #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff --git a/webcit/config.sub b/webcit/config.sub index c2d125724..30fdca812 100755 --- a/webcit/config.sub +++ b/webcit/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2010-01-22' +timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -76,7 +76,7 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -124,8 +124,9 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -157,8 +158,8 @@ case $os in os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -174,10 +175,10 @@ case $os in os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -282,11 +283,13 @@ case $basic_machine in | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ @@ -294,15 +297,24 @@ case $basic_machine in | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -314,6 +326,18 @@ case $basic_machine in basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -334,7 +358,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -368,26 +392,28 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -412,7 +438,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -482,11 +508,20 @@ case $basic_machine in basic_machine=powerpc-ibm os=-cnk ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -518,7 +553,7 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -734,7 +769,7 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -841,6 +876,12 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -923,9 +964,10 @@ case $basic_machine in ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1019,6 +1061,9 @@ case $basic_machine in basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1075,20 +1120,8 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - # This must be matched before tile*. - tilegx*) + # This must be matched before tile*. + tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; @@ -1163,6 +1196,9 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1260,11 +1296,11 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1301,7 +1337,8 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1348,7 +1385,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1397,7 +1434,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1442,8 +1479,8 @@ case $os in -dicos*) os=-dicos ;; - -nacl*) - ;; + -nacl*) + ;; -none) ;; *) @@ -1466,10 +1503,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1481,8 +1518,17 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1509,7 +1555,7 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1536,7 +1582,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff --git a/webcit/sieve.c b/webcit/sieve.c index 635b2fc53..80142ebea 100644 --- a/webcit/sieve.c +++ b/webcit/sieve.c @@ -21,218 +21,7 @@ #define MAX_SCRIPTS 100 #define MAX_RULES 50 #define RULES_SCRIPT "__WebCit_Generated_Script__" - - -/* - * dummy panel indicating to the user that the server doesn't support Sieve - */ -void display_no_sieve(void) { - - output_headers(1, 1, 2, 0, 0, 0); - - wc_printf("
\n"); - wc_printf(""); - wc_printf("

"); - wc_printf(_("View/edit server-side mail filters")); - wc_printf("

\n"); - wc_printf("
\n"); - - wc_printf("
\n"); - - wc_printf("" - "
\n"); - - wc_printf(_("This installation of Citadel was built without support for server-side mail filtering." - "
Please contact your system administrator if you require this feature.
")); - - wc_printf("
\n"); - wDumpContent(1); -} - - -/* - * view/edit sieve config - */ -void display_sieve(void) -{ - char script_names[MAX_SCRIPTS][64]; - int num_scripts = 0; - int active_script = (-1); - char buf[SIZ]; /* Don't make this buffer smaller or it will restrict line length */ - int i; - int rules_script_is_active = 0; - - if (!WC->serv_info->serv_supports_sieve) { - display_no_sieve(); - return; - } - - memset(script_names, 0, sizeof script_names); - - serv_puts("MSIV listscripts"); - serv_getln(buf, sizeof(buf)); - if (buf[0] == '1') while (serv_getln(buf, sizeof(buf)), strcmp(buf, "000")) { - if (num_scripts < MAX_SCRIPTS) { - extract_token(script_names[num_scripts], buf, 0, '|', 64); - if (extract_int(buf, 1) > 0) { - active_script = num_scripts; - if (!strcasecmp(script_names[num_scripts], RULES_SCRIPT)) { - rules_script_is_active = 1; - } - } - ++num_scripts; - } - } - - output_headers(1, 1, 2, 0, 0, 0); - - wc_printf(" \n" - ); - - wc_printf("
\n"); - wc_printf(""); - wc_printf("

"); - wc_printf(_("View/edit server-side mail filters")); - wc_printf("

\n"); - wc_printf("
\n"); - - wc_printf("
\n"); - - wc_printf("" - "
\n"); - - - wc_printf("
\n"); - wc_printf("\n", WC->nonce); - - wc_printf(_("When new mail arrives: ")); - wc_printf(""); - - - - /* The "no filtering" div */ - - wc_printf("
\n"); - wc_printf("


"); - wc_printf(_("Your incoming mail will not be filtered through any scripts.")); - wc_printf("

\n"); - wc_printf("
\n"); - - /* The "webcit managed scripts" div */ - - wc_printf("
\n"); - display_rules_editor_inner_div(); - wc_printf("
\n"); - - /* The "I'm smart and can write my own Sieve scripts" div */ - - wc_printf("
\n"); - - if (num_scripts > 0) { - wc_printf(_("The currently active script is: ")); - wc_printf("\n"); - } - - wc_printf("   "); - wc_printf("%s\n", _("Add or delete scripts")); - - wc_printf("
\n"); - - if (num_scripts > 0) { - for (i=0; i\n", script_names[i]); - wc_printf("\n"); - wc_printf("
\n"); - } - } - } - - wc_printf(" \n" - ); - - wc_printf("\n"); - - - /* The rest of this is common for all panels... */ - - wc_printf("

"); - wc_printf("", _("Save changes")); - wc_printf(" "); - wc_printf("\n", _("Cancel")); - wc_printf("
\n"); - - wc_printf("
\n"); - - wc_printf(" \n" - ); - - wDumpContent(1); - -} - - +#define FOO 1 /* * Helper function for output_sieve_rule() to output strings with quotes escaped @@ -252,6 +41,12 @@ void osr_sanitize(char *str) { } } +void display_add_remove_scripts(char *message); + + + + + /* * Output parseable Sieve script code based on rules input @@ -570,82 +365,330 @@ void parse_fields_from_rule_editor(void) { -/* - * save sieve config - */ -void save_sieve(void) { - int bigaction; - char script_names[MAX_SCRIPTS][64]; - int num_scripts = 0; - int active_script = (-1); - int i; - char this_name[64]; - char buf[256]; +/* + * save sieve config + */ +void save_sieve(void) { + int bigaction; + char script_names[MAX_SCRIPTS][64]; + int num_scripts = 0; + int active_script = (-1); + int i; + char this_name[64]; + char buf[256]; + + if (!havebstr("save_button")) { + strcpy(WC->ImportantMessage, + _("Cancelled. Changes were not saved.")); + display_main_menu(); + return; + } + + parse_fields_from_rule_editor(); + + serv_puts("MSIV listscripts"); + serv_getln(buf, sizeof(buf)); + if (buf[0] == '1') while (serv_getln(buf, sizeof(buf)), strcmp(buf, "000")) { + if (num_scripts < MAX_SCRIPTS) { + extract_token(script_names[num_scripts], buf, 0, '|', 64); + if (extract_int(buf, 1) > 0) { + active_script = num_scripts; + } + ++num_scripts; + } + } + + bigaction = ibstr("bigaction"); + + if (bigaction == 0) { + serv_puts("MSIV setactive||"); + serv_getln(buf, sizeof buf); + } + + else if (bigaction == 1) { + serv_printf("MSIV setactive|%s|", RULES_SCRIPT); + serv_getln(buf, sizeof buf); + } + + else if (bigaction == 2) { + serv_printf("MSIV setactive|%s|", bstr("active_script")); + serv_getln(buf, sizeof buf); + } + + if (num_scripts > 0) { + for (i=0; iImportantMessage, _("Your changes have been saved.")); + display_main_menu(); + return; +} + +/* + * create a new script + * take the web environment script name and create it on the citadel server + */ +void create_script(void) { + char buf[256]; + + serv_printf("MSIV getscript|%s", bstr("script_name")); + serv_getln(buf, sizeof buf); + if (buf[0] == '1') { + while (serv_getln(buf, sizeof(buf)), strcmp(buf, "000")) { + /* flush */ + } +#if FOO + display_add_remove_scripts(_("A script by that name already exists.")); +#endif + return; + } + + serv_printf("MSIV putscript|%s", bstr("script_name")); + serv_getln(buf, sizeof buf); + if (buf[0] == '4') { + serv_puts("keep;"); + serv_puts("000"); +#if FOO + display_add_remove_scripts(_("A new script has been created. Return to the script editing screen to edit and activate it.")); +#endif + return; + } + +#if FOO + display_add_remove_scripts(&buf[4]); +#endif +} + + + + +/* + * delete a script + */ +void delete_script(void) { + char buf[256]; + + serv_printf("MSIV deletescript|%s", bstr("script_name")); + serv_getln(buf, sizeof buf); +#if FOO + display_add_remove_scripts(&buf[4]); +#endif +} + + + +/* + * dummy panel indicating to the user that the server doesn't support Sieve + */ +void display_no_sieve(void) { + + output_headers(1, 1, 2, 0, 0, 0); + do_template("sieve_none"); + wDumpContent(1); +} + +#if FOO +/* + * view/edit sieve config + */ +void display_sieve(void) +{ + char script_names[MAX_SCRIPTS][64]; + int num_scripts = 0; + int active_script = (-1); + char buf[SIZ]; /* Don't make this buffer smaller or it will restrict line length */ + int i; + int rules_script_is_active = 0; + + if (!WC->serv_info->serv_supports_sieve) { + display_no_sieve(); + return; + } + + memset(script_names, 0, sizeof script_names); + + serv_puts("MSIV listscripts"); + serv_getln(buf, sizeof(buf)); + if (buf[0] == '1') while (serv_getln(buf, sizeof(buf)), strcmp(buf, "000")) { + if (num_scripts < MAX_SCRIPTS) { + extract_token(script_names[num_scripts], buf, 0, '|', 64); + if (extract_int(buf, 1) > 0) { + active_script = num_scripts; + if (!strcasecmp(script_names[num_scripts], RULES_SCRIPT)) { + rules_script_is_active = 1; + } + } + ++num_scripts; + } + } + + output_headers(1, 1, 2, 0, 0, 0); + + wc_printf(" \n" + ); + + wc_printf("
\n"); + wc_printf(""); + wc_printf("

"); + wc_printf(_("View/edit server-side mail filters")); + wc_printf("

\n"); + wc_printf("
\n"); + + wc_printf("
\n"); + + wc_printf("" + "
\n"); + + + wc_printf("
\n"); + wc_printf("\n", WC->nonce); + + wc_printf(_("When new mail arrives: ")); + wc_printf(""); + + + + /* The "no filtering" div */ + + wc_printf("
\n"); + wc_printf("


"); + wc_printf(_("Your incoming mail will not be filtered through any scripts.")); + wc_printf("

\n"); + wc_printf("
\n"); - if (!havebstr("save_button")) { - strcpy(WC->ImportantMessage, - _("Cancelled. Changes were not saved.")); - display_main_menu(); - return; - } + /* The "webcit managed scripts" div */ - parse_fields_from_rule_editor(); + wc_printf("
\n"); + display_rules_editor_inner_div(); + wc_printf("
\n"); - serv_puts("MSIV listscripts"); - serv_getln(buf, sizeof(buf)); - if (buf[0] == '1') while (serv_getln(buf, sizeof(buf)), strcmp(buf, "000")) { - if (num_scripts < MAX_SCRIPTS) { - extract_token(script_names[num_scripts], buf, 0, '|', 64); - if (extract_int(buf, 1) > 0) { - active_script = num_scripts; - } - ++num_scripts; - } - } + /* The "I'm smart and can write my own Sieve scripts" div */ - bigaction = ibstr("bigaction"); + wc_printf("
\n"); - if (bigaction == 0) { - serv_puts("MSIV setactive||"); - serv_getln(buf, sizeof buf); + if (num_scripts > 0) { + wc_printf(_("The currently active script is: ")); + wc_printf("\n"); } - else if (bigaction == 1) { - serv_printf("MSIV setactive|%s|", RULES_SCRIPT); - serv_getln(buf, sizeof buf); - } + wc_printf("   "); + wc_printf("%s\n", _("Add or delete scripts")); - else if (bigaction == 2) { - serv_printf("MSIV setactive|%s|", bstr("active_script")); - serv_getln(buf, sizeof buf); - } + wc_printf("
\n"); if (num_scripts > 0) { for (i=0; i\n", script_names[i]); + wc_printf("\n"); + wc_printf("
\n"); } } } - strcpy(WC->ImportantMessage, _("Your changes have been saved.")); - display_main_menu(); - return; + wc_printf(" \n" + ); + + wc_printf("\n"); + + + /* The rest of this is common for all panels... */ + + wc_printf("

"); + wc_printf("", _("Save changes")); + wc_printf(" "); + wc_printf("\n", _("Cancel")); + wc_printf("
\n"); + + wc_printf("
\n"); + + wc_printf(" \n" + ); + + wDumpContent(1); + } + + /* * show a list of available scripts to add/remove them */ @@ -735,48 +778,6 @@ void display_add_remove_scripts(char *message) -/* - * delete a script - */ -void delete_script(void) { - char buf[256]; - - serv_printf("MSIV deletescript|%s", bstr("script_name")); - serv_getln(buf, sizeof buf); - display_add_remove_scripts(&buf[4]); -} - - - -/* - * create a new script - * take the web environment script name and create it on the citadel server - */ -void create_script(void) { - char buf[256]; - - serv_printf("MSIV getscript|%s", bstr("script_name")); - serv_getln(buf, sizeof buf); - if (buf[0] == '1') { - while (serv_getln(buf, sizeof(buf)), strcmp(buf, "000")) { - /* flush */ - } - display_add_remove_scripts(_("A script by that name already exists.")); - return; - } - - serv_printf("MSIV putscript|%s", bstr("script_name")); - serv_getln(buf, sizeof buf); - if (buf[0] == '4') { - serv_puts("keep;"); - serv_puts("000"); - display_add_remove_scripts(_("A new script has been created. Return to the script editing screen to edit and activate it.")); - return; - } - - display_add_remove_scripts(&buf[4]); -} - @@ -1180,16 +1181,501 @@ void display_rules_editor_inner_div(void) { free(rooms); } - void _display_add_remove_scripts(void) {display_add_remove_scripts(NULL);} +#endif + + +typedef struct __SieveListing { + int IsActive; + int IsRulesScript; + StrBuf *Name; + StrBuf *Content; +} SieveListing; + +int ConditionalSieveScriptIsActive(StrBuf *Target, WCTemplputParams *TP) +{ + SieveListing *SieveList = (SieveListing *)CTX; + return SieveList->IsActive; +} +int ConditionalSieveScriptIsRulesScript(StrBuf *Target, WCTemplputParams *TP) +{ + SieveListing *SieveList = (SieveListing *)CTX; + return SieveList->IsActive; +} +void tmplput_SieveScriptName(StrBuf *Target, WCTemplputParams *TP) +{ + SieveListing *SieveList = (SieveListing *)CTX; + StrBufAppendTemplate(Target, TP, SieveList->Name, 0); +} +void tmplput_SieveScriptContent(StrBuf *Target, WCTemplputParams *TP) +{ + SieveListing *SieveList = (SieveListing *)CTX; + StrBufAppendTemplate(Target, TP, SieveList->Content, 0); +} +void FreeSieveListing(void *vSieveListing) +{ + SieveListing *List = (SieveListing*) vSieveListing; + + FreeStrBuf(&List->Name); + free(List); +} + +HashList *GetSieveScriptListing(StrBuf *Target, WCTemplputParams *TP) +{ + wcsession *WCC = WC; + StrBuf *Line; + int num_scripts = 0; + int rules_script_active = 0; + int have_rules_script = 0; + const char *pch; + HashPos *it; + int Done = 0; + SieveListing *Ruleset; + + if (WCC->KnownSieveScripts != NULL) + return WCC->KnownSieveScripts; + + serv_puts("MSIV listscripts"); + Line = NewStrBuf(); + StrBuf_ServGetln(Line); + if (GetServerStatus(Line, NULL) == 1) + { + WCC->KnownSieveScripts = NewHash(1, Flathash); + + while(!Done && (StrBuf_ServGetln(Line) >= 0) ) + if ( (StrLength(Line)==3) && + !strcmp(ChrPtr(Line), "000")) + { + Done = 1; + } + else + { + pch = NULL; + Ruleset = (SieveListing *) malloc(sizeof(SieveListing)); + Ruleset->Name = NewStrBufPlain(NULL, StrLength(Line)); + StrBufExtract_NextToken(Ruleset->Name, Line, &pch, '|'); + Ruleset->IsActive = StrBufExtractNext_int(Line, &pch, '|'); + + if (!strcasecmp(ChrPtr(Ruleset->Name), RULES_SCRIPT)) + { + Ruleset->IsRulesScript = 1; + have_rules_script = 1; + if (Ruleset->IsActive) + { + rules_script_active = 1; + PutBstr(HKEY("__SIEVE:RULESSCRIPT"), NewStrBufPlain(HKEY("1"))); + } + } + Put(WCC->KnownSieveScripts, IKEY(num_scripts), Ruleset, FreeSieveListing); + + ++num_scripts; + } + } + if ((num_scripts > 0) && (rules_script_active == 0)) + PutBstr(HKEY("__SIEVE:EXTERNAL_SCRIPT"), NewStrBufPlain(HKEY("1"))); + + if (num_scripts > have_rules_script) + { + long rc; + long len; + const char *Key; + void *vRuleset; + + /* + * ok; we have custom scripts, expose that via bstr, and load the payload. + */ + PutBstr(HKEY("__SIEVE:HAVE_EXTERNAL_SCRIPT"), NewStrBufPlain(HKEY("1"))); + + it = GetNewHashPos(WCC->KnownSieveScripts, 0); + while (GetNextHashPos(WCC->KnownSieveScripts, it, &len, &Key, &vRuleset) && + (vRuleset != NULL)) + { + Ruleset = (SieveListing *) vRuleset; + + /* + * its the webcit rule? we don't need to load that here. + */ + if (Ruleset->IsRulesScript) + continue; + + if (!serv_printf("MSIV getscript|%s", ChrPtr(Ruleset->Name))) + break; + StrBuf_ServGetln(Line); + if (GetServerStatus(Line, NULL) == 1) + { + Ruleset->Content = NewStrBuf(); + while(!Done && (rc = StrBuf_ServGetln(Line), rc >= 0) ) + if ( (StrLength(Line)==3) && + !strcmp(ChrPtr(Line), "000")) + { + Done = 1; + } + else + { + if (StrLength(Ruleset->Content)>0) + StrBufAppendBufPlain(Ruleset->Content, HKEY("\n"), 0); + StrBufAppendBuf(Ruleset->Content, Line, 0); + } + if (rc < 0) break; + } + } + } + FreeStrBuf(&Line); + return WCC->KnownSieveScripts; +} + + +typedef enum __eSieveHfield +{ + from, + tocc, + subject, + replyto, + sender, + resentfrom, + resentto, + envfrom, + envto, + xmailer, + xspamflag, + xspamstatus, + listid, + size, + all +} eSieveHfield; + +typedef enum __eSieveCompare { + contains, + notcontains, + is, + isnot, + matches, + notmatches +} eSieveCompare; + +typedef enum __eSieveAction { + keep, + discard, + reject, + fileinto, + redirect, + vacation +} eSieveAction; + + +typedef enum __eSieveSizeComp { + larger, + smaller +} eSieveSizeComp; + +typedef enum __eSieveFinal { + econtinue, + estop +} eSieveFinal; + + +typedef struct __SieveRule { + int active; + int sizeval; + eSieveHfield hfield; + eSieveCompare compare; + StrBuf *htext; + eSieveSizeComp sizecomp; + eSieveAction Action; + StrBuf *fileinto; + StrBuf *redirect; + StrBuf *automsg; + eSieveFinal final; +}SieveRule; + + + +int ConditionalSieveRule_hfield(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + + return GetTemplateTokenNumber(Target, + TP, + 3, + from) + == + Rule->hfield; +} +int ConditionalSieveRule_compare(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + return GetTemplateTokenNumber(Target, + TP, + 3, + contains) + == + Rule->compare; +} +int ConditionalSieveRule_action(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + return GetTemplateTokenNumber(Target, + TP, + 3, + keep) + == + Rule->Action; +} +int ConditionalSieveRule_sizecomp(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + return GetTemplateTokenNumber(Target, + TP, + 3, + larger) + == + Rule->sizecomp; +} +int ConditionalSieveRule_final(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + return GetTemplateTokenNumber(Target, + TP, + 3, + econtinue) + == + Rule->final; +} +int ConditionalSieveRule_ThisRoom(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + return GetTemplateTokenNumber(Target, + TP, + 3, + econtinue) + == + Rule->final; +} +int ConditionalSieveRule_Active(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + return Rule->active; +} + + +/* +void tmplput_SieveRule_hfield(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + StrBufAppendTemplate(Target, TP, Rule->hfield, 0); +} +void tmplput_SieveRule_compare(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + StrBufAppendTemplate(Target, TP, Rule->compare, 0); +} +*/ +void tmplput_SieveRule_htext(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + StrBufAppendTemplate(Target, TP, Rule->htext, 0); +} +/* +void tmplput_SieveRule_sizecomp(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + StrBufAppendTemplate(Target, TP, Rule->sizecomp, 0); +} +void tmplput_SieveRule_action(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + StrBufAppendTemplate(Target, TP, Rule->action, 0); + }*/ +void tmplput_SieveRule_fileinto(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + StrBufAppendTemplate(Target, TP, Rule->fileinto, 0); +} +void tmplput_SieveRule_redirect(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + StrBufAppendTemplate(Target, TP, Rule->redirect, 0); +} +void tmplput_SieveRule_automsg(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + StrBufAppendTemplate(Target, TP, Rule->automsg, 0); +} +/* +void tmplput_SieveRule_final(StrBuf *Target, WCTemplputParams *TP) +{ + SieveRule *Rule = (SieveRule *)CTX; + StrBufAppendTemplate(Target, TP, Rule->final, 0); +} +*/ +void FreeSieveRule(void *vRule) +{ + SieveRule *Rule = (SieveRule*) Rule; + + FreeStrBuf(&Rule->htext); + FreeStrBuf(&Rule->fileinto); + FreeStrBuf(&Rule->redirect); + FreeStrBuf(&Rule->automsg); + + free(Rule); +} + +#define WC_RULE_HEADER "# WEBCIT_RULE|" +HashList *GetSieveRules(StrBuf *Target, WCTemplputParams *TP) +{ + StrBuf *Line; + StrBuf *EncodedRule; + int n; + const char *pch; + HashList *SieveRules = NULL; + int Done = 0; + SieveRule *Rule; + + serv_printf("MSIV getscript|"RULES_SCRIPT); + Line = NewStrBuf(); + EncodedRule = NewStrBuf(); + StrBuf_ServGetln(Line); + if (GetServerStatus(Line, NULL) == 1) + { + SieveRules = NewHash(1, Flathash); + + while(!Done && (StrBuf_ServGetln(Line) >= 0) ) + if ( (StrLength(Line)==3) && + !strcmp(ChrPtr(Line), "000")) + { + Done = 1; + } + else + { + pch = NULL; + /* We just care for our encoded header and skip everything else */ + if ((StrLength(Line) > sizeof(WC_RULE_HEADER) - 1) && + (!strncasecmp(ChrPtr(Line), HKEY(WC_RULE_HEADER)))) + { + StrBufSkip_NTokenS(Line, &pch, '|', 1); + n = StrBufExtractNext_int(Line, &pch, '|'); + StrBufExtract_NextToken(EncodedRule, Line, &pch, '|'); + StrBufDecodeBase64(EncodedRule); + + Rule = (SieveRule*) malloc(sizeof(SieveRule)); + + Rule->htext = NewStrBufPlain (NULL, StrLength(EncodedRule)); + + Rule->fileinto = NewStrBufPlain (NULL, StrLength(EncodedRule)); + Rule->redirect = NewStrBufPlain (NULL, StrLength(EncodedRule)); + Rule->automsg = NewStrBufPlain (NULL, StrLength(EncodedRule)); + + /* Grab our existing values to populate */ + pch = NULL; + Rule->active = StrBufExtractNext_int(EncodedRule, &pch, '|'); + StrBufExtract_NextToken(Line, EncodedRule, &pch, '|'); + + Rule->hfield = (eSieveHfield) GetTokenDefine(SKEY(Line), tocc); + StrBufExtract_NextToken(Line, EncodedRule, &pch, '|'); + Rule->compare = (eSieveCompare) GetTokenDefine(SKEY(Line), contains); + StrBufExtract_NextToken(Rule->htext, EncodedRule, &pch, '|'); + StrBufExtract_NextToken(Line, EncodedRule, &pch, '|'); + Rule->sizecomp = (eSieveSizeComp) GetTokenDefine(SKEY(Line), larger); + Rule->sizeval = StrBufExtractNext_int(EncodedRule, &pch, '|'); + StrBufExtract_NextToken(Line, EncodedRule, &pch, '|'); + Rule->Action = (eSieveAction) GetTokenDefine(SKEY(Line), keep); + StrBufExtract_NextToken(Rule->fileinto, EncodedRule, &pch, '|'); + StrBufExtract_NextToken(Rule->redirect, EncodedRule, &pch, '|'); + StrBufExtract_NextToken(Rule->automsg, EncodedRule, &pch, '|'); + StrBufExtract_NextToken(Line, EncodedRule, &pch, '|'); + Rule->final = (eSieveFinal) GetTokenDefine(SKEY(Line), econtinue); + Put(SieveRules, IKEY(n), Rule, FreeSieveRule); + } + } + } + + FreeStrBuf(&EncodedRule); + FreeStrBuf(&Line); + return SieveRules; +} + +void +SessionDetachModule_SIEVE +(wcsession *sess) +{ + DeleteHash(&sess->KnownSieveScripts); +} void InitModule_SIEVE (void) { + REGISTERTokenParamDefine(from); + REGISTERTokenParamDefine(tocc); + REGISTERTokenParamDefine(subject); + REGISTERTokenParamDefine(replyto); + REGISTERTokenParamDefine(sender); + REGISTERTokenParamDefine(resentfrom); + REGISTERTokenParamDefine(resentto); + REGISTERTokenParamDefine(envfrom); + REGISTERTokenParamDefine(envto); + REGISTERTokenParamDefine(xmailer); + REGISTERTokenParamDefine(xspamflag); + REGISTERTokenParamDefine(xspamstatus); + REGISTERTokenParamDefine(listid); + REGISTERTokenParamDefine(size); + REGISTERTokenParamDefine(all); + + REGISTERTokenParamDefine(contains); + REGISTERTokenParamDefine(notcontains); + REGISTERTokenParamDefine(is); + REGISTERTokenParamDefine(isnot); + REGISTERTokenParamDefine(matches); + REGISTERTokenParamDefine(notmatches); + + REGISTERTokenParamDefine(keep); + REGISTERTokenParamDefine(discard); + REGISTERTokenParamDefine(reject); + REGISTERTokenParamDefine(fileinto); + REGISTERTokenParamDefine(redirect); + REGISTERTokenParamDefine(vacation); + + REGISTERTokenParamDefine(larger); + REGISTERTokenParamDefine(smaller); + + /* these are c-keyworads, so do it by hand. */ + RegisterTokenParamDefine(HKEY("continue"), econtinue); + RegisterTokenParamDefine(HKEY("stop"), estop); + + RegisterIterator("SIEVE:SCRIPTS", 0, NULL, GetSieveRules, NULL, NULL, CTX_SIEVELIST, CTX_NONE, IT_NOFLAG); + + RegisterIterator("SIEVE:RULES", 0, NULL, GetSieveRules, NULL, DeleteHash, CTX_SIEVESCRIPT, CTX_NONE, IT_NOFLAG); + + RegisterConditional(HKEY("COND:SIEVE:SCRIPT:ACTIVE"), 0, ConditionalSieveScriptIsActive, CTX_SIEVELIST); + RegisterConditional(HKEY("COND:SIEVE:SCRIPT:ISRULES"), 0, ConditionalSieveScriptIsRulesScript, CTX_SIEVELIST); + RegisterNamespace("SIEVE:SCRIPT:NAME", 0, 1, tmplput_SieveScriptName, NULL, CTX_ROOMS); + RegisterNamespace("SIEVE:SCRIPT:CONTENT", 0, 1, tmplput_SieveScriptContent, NULL, CTX_SIEVELIST); + + + RegisterConditional(HKEY("COND:SIEVE:ACTIVE"), 1, ConditionalSieveRule_Active, CTX_SIEVESCRIPT); + RegisterConditional(HKEY("COND:SIEVE:HFIELD"), 1, ConditionalSieveRule_hfield, CTX_SIEVESCRIPT); + RegisterConditional(HKEY("COND:SIEVE:COMPARE"), 1, ConditionalSieveRule_compare, CTX_SIEVESCRIPT); + RegisterConditional(HKEY("COND:SIEVE:ACTION"), 1, ConditionalSieveRule_action, CTX_SIEVESCRIPT); + RegisterConditional(HKEY("COND:SIEVE:SIZECOMP"), 1, ConditionalSieveRule_sizecomp, CTX_SIEVESCRIPT); + RegisterConditional(HKEY("COND:SIEVE:FINAL"), 1, ConditionalSieveRule_final, CTX_SIEVESCRIPT); + RegisterConditional(HKEY("COND:SIEVE:THISROOM"), 1, ConditionalSieveRule_ThisRoom, CTX_SIEVESCRIPT); + + //RegisterNamespace("SIEVE:SCRIPT:HFIELD", 0, 1, tmplput_SieveRule_hfield, NULL, CTX_SIEVESCRIPT); + //RegisterNamespace("SIEVE:SCRIPT:COMPARE", 0, 1, tmplput_SieveRule_compare, NULL, CTX_SIEVESCRIPT); + RegisterNamespace("SIEVE:SCRIPT:HTEXT", 0, 1, tmplput_SieveRule_htext, NULL, CTX_SIEVESCRIPT); + //RegisterNamespace("SIEVE:SCRIPT:SIZECOMP", 0, 1, tmplput_SieveRule_sizecomp, NULL, CTX_SIEVESCRIPT); + ///RegisterNamespace("SIEVE:SCRIPT:ACTION", 0, 1, tmplput_SieveRule_action, NULL, CTX_SIEVESCRIPT); + RegisterNamespace("SIEVE:SCRIPT:FILEINTO", 0, 1, tmplput_SieveRule_fileinto, NULL, CTX_SIEVESCRIPT); + RegisterNamespace("SIEVE:SCRIPT:REDIRECT", 0, 1, tmplput_SieveRule_redirect, NULL, CTX_SIEVESCRIPT); + RegisterNamespace("SIEVE:SCRIPT:AUTOMSG", 0, 1, tmplput_SieveRule_automsg, NULL, CTX_SIEVESCRIPT); + ///RegisterNamespace("SIEVE:SCRIPT:FINAL", 0, 1, tmplput_SieveRule_final, NULL, CTX_SIEVESCRIPT); + +#if FOO WebcitAddUrlHandler(HKEY("display_sieve"), "", 0, display_sieve, 0); - WebcitAddUrlHandler(HKEY("save_sieve"), "", 0, save_sieve, 0); WebcitAddUrlHandler(HKEY("display_add_remove_scripts"), "", 0, _display_add_remove_scripts, 0); +#endif + WebcitAddUrlHandler(HKEY("save_sieve"), "", 0, save_sieve, 0); + WebcitAddUrlHandler(HKEY("create_script"), "", 0, create_script, 0); WebcitAddUrlHandler(HKEY("delete_script"), "", 0, delete_script, 0); } diff --git a/webcit/static/t/sieve/add.html b/webcit/static/t/sieve/add.html new file mode 100644 index 000000000..9eea08e86 --- /dev/null +++ b/webcit/static/t/sieve/add.html @@ -0,0 +1,32 @@ + + +
+ + +
+ + +

+ +
+ + +
+
+ + +


+ +
+ + +

+
+ + diff --git a/webcit/static/t/sieve/display.html b/webcit/static/t/sieve/display.html new file mode 100644 index 000000000..222dd346f --- /dev/null +++ b/webcit/static/t/sieve/display.html @@ -0,0 +1,123 @@ + +/* + * This script should get called by every onChange event... + * + */ + + + +
+ +

+ + diff --git a/webcit/static/t/sieve/display_one.html b/webcit/static/t/sieve/display_one.html new file mode 100644 index 000000000..49329c4ec --- /dev/null +++ b/webcit/static/t/sieve/display_one.html @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + +
+
+> +
+ + + + + +
+ + + + + +
+ + +"> escputs(htext); +
+ +
+ +
+ + +
+
+ + +
+ +
+ +
+
+ +

+ +
+ +
< _("and then")> + +
diff --git a/webcit/static/t/sieve/display_one_script.html b/webcit/static/t/sieve/display_one_script.html new file mode 100644 index 000000000..658d75a02 --- /dev/null +++ b/webcit/static/t/sieve/display_one_script.html @@ -0,0 +1,3 @@ +
" style="display:none"> + +
diff --git a/webcit/static/t/sieve/empty.html b/webcit/static/t/sieve/empty.html new file mode 100644 index 000000000..e69de29bb diff --git a/webcit/static/t/sieve/list.html b/webcit/static/t/sieve/list.html new file mode 100644 index 000000000..f564250d2 --- /dev/null +++ b/webcit/static/t/sieve/list.html @@ -0,0 +1,85 @@ + + + +
+ + +
+ + + + + + + + + + + + + + + + +

+ +  + +
+ +
+ + + + diff --git a/webcit/static/t/sieve/list_select_one.html b/webcit/static/t/sieve/list_select_one.html new file mode 100644 index 000000000..f546351aa --- /dev/null +++ b/webcit/static/t/sieve/list_select_one.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/sieve/none.html b/webcit/static/t/sieve/none.html new file mode 100644 index 000000000..61d62c3ef --- /dev/null +++ b/webcit/static/t/sieve/none.html @@ -0,0 +1,14 @@ + + + +
+
+Please contact your system administrator if you require this feature.
")> + +
+ diff --git a/webcit/static/t/sieve/roomlist.html b/webcit/static/t/sieve/roomlist.html new file mode 100644 index 000000000..818b5f9f4 --- /dev/null +++ b/webcit/static/t/sieve/roomlist.html @@ -0,0 +1 @@ + diff --git a/webcit/subst.c b/webcit/subst.c index 354b51601..c737e75fb 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -109,6 +109,8 @@ const char *CtxNames[] = { "Context DavNamespace", "Context TAB", "Context VCARD", + "Context SIEVE List", + "Context SIEVE Script", "Context UNKNOWN" }; diff --git a/webcit/subst.h b/webcit/subst.h index ed0d4500a..644b55950 100644 --- a/webcit/subst.h +++ b/webcit/subst.h @@ -16,7 +16,7 @@ extern HashList *LocalTemplateCache; #define TYPE_BSTR 6 #define TYPE_SUBTEMPLATE 7 #define TYPE_INTDEFINE 8 -#define MAXPARAM 20 +#define MAXPARAM 25 #define IS_NUMBER(a) ((a == TYPE_LONG) || (a == TYPE_PREFINT) || (a == TYPE_INTDEFINE)) @@ -57,8 +57,10 @@ enum { #define CTX_DAVNS 19 #define CTX_TAB 20 #define CTX_VCARD 21 +#define CTX_SIEVELIST 22 +#define CTX_SIEVESCRIPT 23 -#define CTX_UNKNOWN 22 +#define CTX_UNKNOWN 24 /** diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index 687580e2d..8d3c6a885 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -275,7 +275,7 @@ void FlushReadBuf (void) pche = pch + len; if (WCC->ReadPos != pche) { - syslog(1, "ERROR: somebody didn't eat his soup! Remaing Chars: %d [%s]\n", + syslog(1, "ERROR: somebody didn't eat his soup! Remaing Chars: %ld [%s]\n", pche - WCC->ReadPos, pche); syslog(1, "--------------------------------------------------------------------------------\n" @@ -298,7 +298,7 @@ void FlushReadBuf (void) * buf the buffer to write to citadel server * nbytes how many bytes to send to citadel server */ -void serv_write(const char *buf, int nbytes) +int serv_write(const char *buf, int nbytes) { wcsession *WCC = WC; int bytes_written = 0; @@ -316,10 +316,11 @@ void serv_write(const char *buf, int nbytes) WCC->serv_sock = (-1); WCC->connected = 0; WCC->logged_in = 0; - return; + return 0; } bytes_written = bytes_written + retval; } + return 1; } @@ -327,30 +328,32 @@ void serv_write(const char *buf, int nbytes) * send line to server * string the line to send to the citadel server */ -void serv_puts(const char *string) +int serv_puts(const char *string) { #ifdef SERV_TRACE syslog(9, "%3d>>>%s\n", WC->serv_sock, string); #endif FlushReadBuf(); - serv_write(string, strlen(string)); - serv_write("\n", 1); + if (!serv_write(string, strlen(string))) + return 0; + return serv_write("\n", 1); } /* * send line to server * string the line to send to the citadel server */ -void serv_putbuf(const StrBuf *string) +int serv_putbuf(const StrBuf *string) { #ifdef SERV_TRACE syslog(9, "%3d>>>%s\n", WC->serv_sock, ChrPtr(string)); #endif FlushReadBuf(); - serv_write(ChrPtr(string), StrLength(string)); - serv_write("\n", 1); + if (!serv_write(ChrPtr(string), StrLength(string))) + return 0; + return serv_write("\n", 1); } @@ -359,11 +362,12 @@ void serv_putbuf(const StrBuf *string) * format the formatstring * ... the entities to insert into format */ -void serv_printf(const char *format,...) +int serv_printf(const char *format,...) { va_list arg_ptr; char buf[SIZ]; size_t len; + int rc; FlushReadBuf(); @@ -374,10 +378,11 @@ void serv_printf(const char *format,...) len = strlen(buf); buf[len++] = '\n'; buf[len] = '\0'; - serv_write(buf, len); + rc = serv_write(buf, len); #ifdef SERV_TRACE syslog(9, ">>>%s", buf); #endif + return rc; } @@ -403,7 +408,7 @@ int serv_read_binary(StrBuf *Ret, size_t total_len, StrBuf *Buf) return -1; } - serv_printf("READ %d|%d", bytes_read, total_len-bytes_read); + 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 < 0) diff --git a/webcit/webcit.h b/webcit/webcit.h index 9872800b4..efb7f8242 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -564,6 +564,9 @@ struct wcsession { int ib_wholist_expanded; int ib_roomlist_expanded; +/* our known Sieve scripts; loaded by SIEVE:SCRIPTS iterator. */ + HashList *KnownSieveScripts; + /* Transcoding cache buffers; used to avoid to frequent realloc */ StrBuf *ConvertBuf1; StrBuf *ConvertBuf2; @@ -662,7 +665,7 @@ int tcp_connectsock(char *, char *); int serv_getln(char *strbuf, int bufsize); int StrBuf_ServGetln(StrBuf *buf); int GetServerStatus(StrBuf *Line, long* FullState); -void serv_puts(const char *string); +int serv_puts(const char *string); void who(void); void push_destination(void); void pop_destination(void); @@ -734,11 +737,6 @@ long gotoroom(const StrBuf *gname); void remove_march(const StrBuf *aaa); void dotskip(void); void validate(void); -void display_graphics_upload(char *, char *, char *); -void do_graphics_upload(char *upl_cmd); -void serv_write(const char *buf, int nbytes); -void serv_putbuf(const StrBuf *string); -void serv_printf(const char *format,...)__attribute__((__format__(__printf__,1,2))); void shutdown_sessions(void); void do_housekeeping(void); void smart_goto(const StrBuf *); @@ -809,6 +807,11 @@ int ical_ctdl_is_overlap( extern char *months[]; extern char *days[]; +void display_graphics_upload(char *, char *, char *); +void do_graphics_upload(char *upl_cmd); +int serv_write(const char *buf, int nbytes); +int serv_putbuf(const StrBuf *string); +int serv_printf(const char *format,...)__attribute__((__format__(__printf__,1,2))); int serv_read_binary(StrBuf *Ret, size_t total_len, StrBuf *Buf); int StrBuf_ServGetBLOB(StrBuf *buf, long BlobSize); int StrBuf_ServGetBLOBBuffered(StrBuf *buf, long BlobSize); -- 2.30.2