Codebase list cyrus-imapd / upstream/2.4.11
Imported Upstream version 2.4.11 Ondřej Surý 12 years ago
110 changed file(s) with 6417 addition(s) and 3536 deletion(s). Raw diff Collapse all Expand all
6363 COMPILE_ET = @COMPILE_ET@
6464
6565 PACKAGE = cyrus-imapd
66 VERSION = 2.4.9
66 VERSION = 2.4.11
6767 GIT_VERSION = $(VERSION).git$(shell date +'%Y%m%d%H%M')
6868
6969 all:: xversion
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.67.
2 # Generated by GNU Autoconf 2.68.
33 #
44 #
55 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
8888 IFS=" "" $as_nl"
8989
9090 # Find who we are. Look in the path if we contain no directory separator.
91 as_myself=
9192 case $0 in #((
9293 *[\\/]* ) as_myself=$0 ;;
9394 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
213214 # We cannot yet assume a decent shell, so we have to provide a
214215 # neutralization value for shells without unset; and this also
215216 # works around shells that cannot unset nonexistent variables.
217 # Preserve -v and -x to the replacement shell.
216218 BASH_ENV=/dev/null
217219 ENV=/dev/null
218220 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
219221 export CONFIG_SHELL
220 exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
222 case $- in # ((((
223 *v*x* | *x*v* ) as_opts=-vx ;;
224 *v* ) as_opts=-v ;;
225 *x* ) as_opts=-x ;;
226 * ) as_opts= ;;
227 esac
228 exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
221229 fi
222230
223231 if test x$as_have_required = xno; then :
11951203 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
11961204 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
11971205 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1198 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
1206 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
11991207 ;;
12001208
12011209 esac
14761484 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
14771485 you have headers in a nonstandard directory <include dir>
14781486 CPP C preprocessor
1479 YACC The `Yet Another C Compiler' implementation to use. Defaults to
1480 the first program found out of: `bison -y', `byacc', `yacc'.
1487 YACC The `Yet Another Compiler Compiler' implementation to use.
1488 Defaults to the first program found out of: `bison -y', `byacc',
1489 `yacc'.
14811490 YFLAGS The list of arguments that will be passed by default to $YACC.
14821491 This script will default YFLAGS to the empty string to avoid a
14831492 default value of `-d' given by some make applications.
15491558 if $ac_init_version; then
15501559 cat <<\_ACEOF
15511560 configure
1552 generated by GNU Autoconf 2.67
1561 generated by GNU Autoconf 2.68
15531562
15541563 Copyright (C) 2010 Free Software Foundation, Inc.
15551564 This configure script is free software; the Free Software Foundation
15951604
15961605 ac_retval=1
15971606 fi
1598 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1607 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
15991608 as_fn_set_status $ac_retval
16001609
16011610 } # ac_fn_c_try_compile
16321641
16331642 ac_retval=1
16341643 fi
1635 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1644 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
16361645 as_fn_set_status $ac_retval
16371646
16381647 } # ac_fn_c_try_cpp
16451654 ac_fn_c_check_header_mongrel ()
16461655 {
16471656 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1648 if eval "test \"\${$3+set}\"" = set; then :
1657 if eval \${$3+:} false; then :
16491658 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
16501659 $as_echo_n "checking for $2... " >&6; }
1651 if eval "test \"\${$3+set}\"" = set; then :
1660 if eval \${$3+:} false; then :
16521661 $as_echo_n "(cached) " >&6
16531662 fi
16541663 eval ac_res=\$$3
17111720 esac
17121721 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
17131722 $as_echo_n "checking for $2... " >&6; }
1714 if eval "test \"\${$3+set}\"" = set; then :
1723 if eval \${$3+:} false; then :
17151724 $as_echo_n "(cached) " >&6
17161725 else
17171726 eval "$3=\$ac_header_compiler"
17201729 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17211730 $as_echo "$ac_res" >&6; }
17221731 fi
1723 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1732 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17241733
17251734 } # ac_fn_c_check_header_mongrel
17261735
17611770 ac_retval=$ac_status
17621771 fi
17631772 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1764 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1773 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17651774 as_fn_set_status $ac_retval
17661775
17671776 } # ac_fn_c_try_run
17751784 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
17761785 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
17771786 $as_echo_n "checking for $2... " >&6; }
1778 if eval "test \"\${$3+set}\"" = set; then :
1787 if eval \${$3+:} false; then :
17791788 $as_echo_n "(cached) " >&6
17801789 else
17811790 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17931802 eval ac_res=\$$3
17941803 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17951804 $as_echo "$ac_res" >&6; }
1796 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1805 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17971806
17981807 } # ac_fn_c_check_header_compile
17991808
18381847 # interfere with the next link command; also delete a directory that is
18391848 # left behind by Apple's compiler. We do this before executing the actions.
18401849 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1841 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1850 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
18421851 as_fn_set_status $ac_retval
18431852
18441853 } # ac_fn_c_try_link
20162025 rm -f conftest.val
20172026
20182027 fi
2019 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
2028 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
20202029 as_fn_set_status $ac_retval
20212030
20222031 } # ac_fn_c_compute_int
20292038 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
20302039 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
20312040 $as_echo_n "checking for $2... " >&6; }
2032 if eval "test \"\${$3+set}\"" = set; then :
2041 if eval \${$3+:} false; then :
20332042 $as_echo_n "(cached) " >&6
20342043 else
20352044 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20842093 eval ac_res=\$$3
20852094 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
20862095 $as_echo "$ac_res" >&6; }
2087 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
2096 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
20882097
20892098 } # ac_fn_c_check_func
20902099
20972106 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
20982107 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
20992108 $as_echo_n "checking for $2.$3... " >&6; }
2100 if eval "test \"\${$4+set}\"" = set; then :
2109 if eval \${$4+:} false; then :
21012110 $as_echo_n "(cached) " >&6
21022111 else
21032112 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21412150 eval ac_res=\$$4
21422151 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
21432152 $as_echo "$ac_res" >&6; }
2144 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
2153 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
21452154
21462155 } # ac_fn_c_check_member
21472156
21562165 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
21572166 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
21582167 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
2159 if eval "test \"\${$3+set}\"" = set; then :
2168 if eval \${$3+:} false; then :
21602169 $as_echo_n "(cached) " >&6
21612170 else
21622171 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21872196 eval ac_res=\$$3
21882197 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
21892198 $as_echo "$ac_res" >&6; }
2190 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
2199 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
21912200
21922201 } # ac_fn_c_check_decl
21932202 cat >config.log <<_ACEOF
21952204 running configure, to aid debugging if configure makes a mistake.
21962205
21972206 It was created by $as_me, which was
2198 generated by GNU Autoconf 2.67. Invocation command line was
2207 generated by GNU Autoconf 2.68. Invocation command line was
21992208
22002209 $ $0 $@
22012210
24532462 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
24542463 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
24552464 as_fn_error $? "failed to load site script $ac_site_file
2456 See \`config.log' for more details" "$LINENO" 5 ; }
2465 See \`config.log' for more details" "$LINENO" 5; }
24572466 fi
24582467 done
24592468
25802589
25812590 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
25822591 $as_echo_n "checking build system type... " >&6; }
2583 if test "${ac_cv_build+set}" = set; then :
2592 if ${ac_cv_build+:} false; then :
25842593 $as_echo_n "(cached) " >&6
25852594 else
25862595 ac_build_alias=$build_alias
25962605 $as_echo "$ac_cv_build" >&6; }
25972606 case $ac_cv_build in
25982607 *-*-*) ;;
2599 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
2608 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
26002609 esac
26012610 build=$ac_cv_build
26022611 ac_save_IFS=$IFS; IFS='-'
26142623
26152624 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
26162625 $as_echo_n "checking host system type... " >&6; }
2617 if test "${ac_cv_host+set}" = set; then :
2626 if ${ac_cv_host+:} false; then :
26182627 $as_echo_n "(cached) " >&6
26192628 else
26202629 if test "x$host_alias" = x; then
26292638 $as_echo "$ac_cv_host" >&6; }
26302639 case $ac_cv_host in
26312640 *-*-*) ;;
2632 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
2641 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
26332642 esac
26342643 host=$ac_cv_host
26352644 ac_save_IFS=$IFS; IFS='-'
26472656
26482657 { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
26492658 $as_echo_n "checking target system type... " >&6; }
2650 if test "${ac_cv_target+set}" = set; then :
2659 if ${ac_cv_target+:} false; then :
26512660 $as_echo_n "(cached) " >&6
26522661 else
26532662 if test "x$target_alias" = x; then
26622671 $as_echo "$ac_cv_target" >&6; }
26632672 case $ac_cv_target in
26642673 *-*-*) ;;
2665 *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;;
2674 *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
26662675 esac
26672676 target=$ac_cv_target
26682677 ac_save_IFS=$IFS; IFS='-'
27012710 set dummy makedepend; ac_word=$2
27022711 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27032712 $as_echo_n "checking for $ac_word... " >&6; }
2704 if test "${ac_cv_prog_MAKEDEPEND+set}" = set; then :
2713 if ${ac_cv_prog_MAKEDEPEND+:} false; then :
27052714 $as_echo_n "(cached) " >&6
27062715 else
27072716 if test -n "$MAKEDEPEND"; then
28192828 set dummy ${ac_tool_prefix}gcc; ac_word=$2
28202829 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
28212830 $as_echo_n "checking for $ac_word... " >&6; }
2822 if test "${ac_cv_prog_CC+set}" = set; then :
2831 if ${ac_cv_prog_CC+:} false; then :
28232832 $as_echo_n "(cached) " >&6
28242833 else
28252834 if test -n "$CC"; then
28592868 set dummy gcc; ac_word=$2
28602869 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
28612870 $as_echo_n "checking for $ac_word... " >&6; }
2862 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
2871 if ${ac_cv_prog_ac_ct_CC+:} false; then :
28632872 $as_echo_n "(cached) " >&6
28642873 else
28652874 if test -n "$ac_ct_CC"; then
29122921 set dummy ${ac_tool_prefix}cc; ac_word=$2
29132922 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29142923 $as_echo_n "checking for $ac_word... " >&6; }
2915 if test "${ac_cv_prog_CC+set}" = set; then :
2924 if ${ac_cv_prog_CC+:} false; then :
29162925 $as_echo_n "(cached) " >&6
29172926 else
29182927 if test -n "$CC"; then
29522961 set dummy cc; ac_word=$2
29532962 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29542963 $as_echo_n "checking for $ac_word... " >&6; }
2955 if test "${ac_cv_prog_CC+set}" = set; then :
2964 if ${ac_cv_prog_CC+:} false; then :
29562965 $as_echo_n "(cached) " >&6
29572966 else
29582967 if test -n "$CC"; then
30113020 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
30123021 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30133022 $as_echo_n "checking for $ac_word... " >&6; }
3014 if test "${ac_cv_prog_CC+set}" = set; then :
3023 if ${ac_cv_prog_CC+:} false; then :
30153024 $as_echo_n "(cached) " >&6
30163025 else
30173026 if test -n "$CC"; then
30553064 set dummy $ac_prog; ac_word=$2
30563065 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30573066 $as_echo_n "checking for $ac_word... " >&6; }
3058 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
3067 if ${ac_cv_prog_ac_ct_CC+:} false; then :
30593068 $as_echo_n "(cached) " >&6
30603069 else
30613070 if test -n "$ac_ct_CC"; then
31103119 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
31113120 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
31123121 as_fn_error $? "no acceptable C compiler found in \$PATH
3113 See \`config.log' for more details" "$LINENO" 5 ; }
3122 See \`config.log' for more details" "$LINENO" 5; }
31143123
31153124 # Provide some information about the compiler.
31163125 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
32253234 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
32263235 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
32273236 as_fn_error 77 "C compiler cannot create executables
3228 See \`config.log' for more details" "$LINENO" 5 ; }
3237 See \`config.log' for more details" "$LINENO" 5; }
32293238 else
32303239 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32313240 $as_echo "yes" >&6; }
32683277 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
32693278 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
32703279 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
3271 See \`config.log' for more details" "$LINENO" 5 ; }
3280 See \`config.log' for more details" "$LINENO" 5; }
32723281 fi
32733282 rm -f conftest conftest$ac_cv_exeext
32743283 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
33273336 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
33283337 as_fn_error $? "cannot run C compiled programs.
33293338 If you meant to cross compile, use \`--host'.
3330 See \`config.log' for more details" "$LINENO" 5 ; }
3339 See \`config.log' for more details" "$LINENO" 5; }
33313340 fi
33323341 fi
33333342 fi
33383347 ac_clean_files=$ac_clean_files_save
33393348 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
33403349 $as_echo_n "checking for suffix of object files... " >&6; }
3341 if test "${ac_cv_objext+set}" = set; then :
3350 if ${ac_cv_objext+:} false; then :
33423351 $as_echo_n "(cached) " >&6
33433352 else
33443353 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33793388 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
33803389 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
33813390 as_fn_error $? "cannot compute suffix of object files: cannot compile
3382 See \`config.log' for more details" "$LINENO" 5 ; }
3391 See \`config.log' for more details" "$LINENO" 5; }
33833392 fi
33843393 rm -f conftest.$ac_cv_objext conftest.$ac_ext
33853394 fi
33893398 ac_objext=$OBJEXT
33903399 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
33913400 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
3392 if test "${ac_cv_c_compiler_gnu+set}" = set; then :
3401 if ${ac_cv_c_compiler_gnu+:} false; then :
33933402 $as_echo_n "(cached) " >&6
33943403 else
33953404 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34263435 ac_save_CFLAGS=$CFLAGS
34273436 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
34283437 $as_echo_n "checking whether $CC accepts -g... " >&6; }
3429 if test "${ac_cv_prog_cc_g+set}" = set; then :
3438 if ${ac_cv_prog_cc_g+:} false; then :
34303439 $as_echo_n "(cached) " >&6
34313440 else
34323441 ac_save_c_werror_flag=$ac_c_werror_flag
35043513 fi
35053514 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
35063515 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
3507 if test "${ac_cv_prog_cc_c89+set}" = set; then :
3516 if ${ac_cv_prog_cc_c89+:} false; then :
35083517 $as_echo_n "(cached) " >&6
35093518 else
35103519 ac_cv_prog_cc_c89=no
36043613 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
36053614 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
36063615 $as_echo_n "checking for $ac_word... " >&6; }
3607 if test "${ac_cv_prog_RANLIB+set}" = set; then :
3616 if ${ac_cv_prog_RANLIB+:} false; then :
36083617 $as_echo_n "(cached) " >&6
36093618 else
36103619 if test -n "$RANLIB"; then
36443653 set dummy ranlib; ac_word=$2
36453654 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
36463655 $as_echo_n "checking for $ac_word... " >&6; }
3647 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
3656 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
36483657 $as_echo_n "(cached) " >&6
36493658 else
36503659 if test -n "$ac_ct_RANLIB"; then
36953704 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
36963705 set x ${MAKE-make}
36973706 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
3698 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
3707 if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
36993708 $as_echo_n "(cached) " >&6
37003709 else
37013710 cat >conftest.make <<\_ACEOF
37393748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
37403749 $as_echo_n "checking for a BSD-compatible install... " >&6; }
37413750 if test -z "$INSTALL"; then
3742 if test "${ac_cv_path_install+set}" = set; then :
3751 if ${ac_cv_path_install+:} false; then :
37433752 $as_echo_n "(cached) " >&6
37443753 else
37453754 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
38283837 CPP=
38293838 fi
38303839 if test -z "$CPP"; then
3831 if test "${ac_cv_prog_CPP+set}" = set; then :
3840 if ${ac_cv_prog_CPP+:} false; then :
38323841 $as_echo_n "(cached) " >&6
38333842 else
38343843 # Double quotes because CPP needs to be expanded
39443953 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
39453954 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
39463955 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
3947 See \`config.log' for more details" "$LINENO" 5 ; }
3956 See \`config.log' for more details" "$LINENO" 5; }
39483957 fi
39493958
39503959 ac_ext=c
39563965
39573966 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
39583967 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
3959 if test "${ac_cv_path_GREP+set}" = set; then :
3968 if ${ac_cv_path_GREP+:} false; then :
39603969 $as_echo_n "(cached) " >&6
39613970 else
39623971 if test -z "$GREP"; then
40194028
40204029 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
40214030 $as_echo_n "checking for egrep... " >&6; }
4022 if test "${ac_cv_path_EGREP+set}" = set; then :
4031 if ${ac_cv_path_EGREP+:} false; then :
40234032 $as_echo_n "(cached) " >&6
40244033 else
40254034 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
40864095
40874096 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
40884097 $as_echo_n "checking for ANSI C header files... " >&6; }
4089 if test "${ac_cv_header_stdc+set}" = set; then :
4098 if ${ac_cv_header_stdc+:} false; then :
40904099 $as_echo_n "(cached) " >&6
40914100 else
40924101 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42154224
42164225
42174226 ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
4218 if test "x$ac_cv_header_minix_config_h" = x""yes; then :
4227 if test "x$ac_cv_header_minix_config_h" = xyes; then :
42194228 MINIX=yes
42204229 else
42214230 MINIX=
42374246
42384247 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
42394248 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
4240 if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
4249 if ${ac_cv_safe_to_define___extensions__+:} false; then :
42414250 $as_echo_n "(cached) " >&6
42424251 else
42434252 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42774286
42784287 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
42794288 $as_echo_n "checking for library containing strerror... " >&6; }
4280 if test "${ac_cv_search_strerror+set}" = set; then :
4289 if ${ac_cv_search_strerror+:} false; then :
42814290 $as_echo_n "(cached) " >&6
42824291 else
42834292 ac_func_search_save_LIBS=$LIBS
43114320 fi
43124321 rm -f core conftest.err conftest.$ac_objext \
43134322 conftest$ac_exeext
4314 if test "${ac_cv_search_strerror+set}" = set; then :
4323 if ${ac_cv_search_strerror+:} false; then :
43154324 break
43164325 fi
43174326 done
4318 if test "${ac_cv_search_strerror+set}" = set; then :
4327 if ${ac_cv_search_strerror+:} false; then :
43194328
43204329 else
43214330 ac_cv_search_strerror=no
43374346 set dummy $ac_prog; ac_word=$2
43384347 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
43394348 $as_echo_n "checking for $ac_word... " >&6; }
4340 if test "${ac_cv_prog_AWK+set}" = set; then :
4349 if ${ac_cv_prog_AWK+:} false; then :
43414350 $as_echo_n "(cached) " >&6
43424351 else
43434352 if test -n "$AWK"; then
43754384
43764385 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
43774386 $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
4378 if test "${ac_cv_c_const+set}" = set; then :
4387 if ${ac_cv_c_const+:} false; then :
43794388 $as_echo_n "(cached) " >&6
43804389 else
43814390 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44554464
44564465 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long file names" >&5
44574466 $as_echo_n "checking for long file names... " >&6; }
4458 if test "${ac_cv_sys_long_file_names+set}" = set; then :
4467 if ${ac_cv_sys_long_file_names+:} false; then :
44594468 $as_echo_n "(cached) " >&6
44604469 else
44614470 ac_cv_sys_long_file_names=yes
44984507 fi
44994508 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
45004509 $as_echo_n "checking for inline... " >&6; }
4501 if test "${ac_cv_c_inline+set}" = set; then :
4510 if ${ac_cv_c_inline+:} false; then :
45024511 $as_echo_n "(cached) " >&6
45034512 else
45044513 ac_cv_c_inline=no
45454554 # This bug is HP SR number 8606223364.
45464555 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
45474556 $as_echo_n "checking size of int... " >&6; }
4548 if test "${ac_cv_sizeof_int+set}" = set; then :
4557 if ${ac_cv_sizeof_int+:} false; then :
45494558 $as_echo_n "(cached) " >&6
45504559 else
45514560 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
45554564 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
45564565 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
45574566 as_fn_error 77 "cannot compute sizeof (int)
4558 See \`config.log' for more details" "$LINENO" 5 ; }
4567 See \`config.log' for more details" "$LINENO" 5; }
45594568 else
45604569 ac_cv_sizeof_int=0
45614570 fi
45784587 # This bug is HP SR number 8606223364.
45794588 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
45804589 $as_echo_n "checking size of long... " >&6; }
4581 if test "${ac_cv_sizeof_long+set}" = set; then :
4590 if ${ac_cv_sizeof_long+:} false; then :
45824591 $as_echo_n "(cached) " >&6
45834592 else
45844593 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
45884597 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
45894598 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
45904599 as_fn_error 77 "cannot compute sizeof (long)
4591 See \`config.log' for more details" "$LINENO" 5 ; }
4600 See \`config.log' for more details" "$LINENO" 5; }
45924601 else
45934602 ac_cv_sizeof_long=0
45944603 fi
46114620 # This bug is HP SR number 8606223364.
46124621 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
46134622 $as_echo_n "checking size of size_t... " >&6; }
4614 if test "${ac_cv_sizeof_size_t+set}" = set; then :
4623 if ${ac_cv_sizeof_size_t+:} false; then :
46154624 $as_echo_n "(cached) " >&6
46164625 else
46174626 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then :
46214630 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
46224631 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
46234632 as_fn_error 77 "cannot compute sizeof (size_t)
4624 See \`config.log' for more details" "$LINENO" 5 ; }
4633 See \`config.log' for more details" "$LINENO" 5; }
46254634 else
46264635 ac_cv_sizeof_size_t=0
46274636 fi
46444653 # This bug is HP SR number 8606223364.
46454654 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
46464655 $as_echo_n "checking size of off_t... " >&6; }
4647 if test "${ac_cv_sizeof_off_t+set}" = set; then :
4656 if ${ac_cv_sizeof_off_t+:} false; then :
46484657 $as_echo_n "(cached) " >&6
46494658 else
46504659 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
46544663 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
46554664 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
46564665 as_fn_error 77 "cannot compute sizeof (off_t)
4657 See \`config.log' for more details" "$LINENO" 5 ; }
4666 See \`config.log' for more details" "$LINENO" 5; }
46584667 else
46594668 ac_cv_sizeof_off_t=0
46604669 fi
46784687 # This bug is HP SR number 8606223364.
46794688 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5
46804689 $as_echo_n "checking size of long long int... " >&6; }
4681 if test "${ac_cv_sizeof_long_long_int+set}" = set; then :
4690 if ${ac_cv_sizeof_long_long_int+:} false; then :
46824691 $as_echo_n "(cached) " >&6
46834692 else
46844693 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then :
46884697 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
46894698 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
46904699 as_fn_error 77 "cannot compute sizeof (long long int)
4691 See \`config.log' for more details" "$LINENO" 5 ; }
4700 See \`config.log' for more details" "$LINENO" 5; }
46924701 else
46934702 ac_cv_sizeof_long_long_int=0
46944703 fi
47114720 # This bug is HP SR number 8606223364.
47124721 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long int" >&5
47134722 $as_echo_n "checking size of unsigned long long int... " >&6; }
4714 if test "${ac_cv_sizeof_unsigned_long_long_int+set}" = set; then :
4723 if ${ac_cv_sizeof_unsigned_long_long_int+:} false; then :
47154724 $as_echo_n "(cached) " >&6
47164725 else
47174726 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long int))" "ac_cv_sizeof_unsigned_long_long_int" "$ac_includes_default"; then :
47214730 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
47224731 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
47234732 as_fn_error 77 "cannot compute sizeof (unsigned long long int)
4724 See \`config.log' for more details" "$LINENO" 5 ; }
4733 See \`config.log' for more details" "$LINENO" 5; }
47254734 else
47264735 ac_cv_sizeof_unsigned_long_long_int=0
47274736 fi
47454754
47464755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
47474756 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
4748 if test "${ac_cv_c_bigendian+set}" = set; then :
4757 if ${ac_cv_c_bigendian+:} false; then :
47494758 $as_echo_n "(cached) " >&6
47504759 else
47514760 ac_cv_c_bigendian=unknown
49644973 ;; #(
49654974 *)
49664975 as_fn_error $? "unknown endianness
4967 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
4976 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
49684977 esac
49694978
49704979 fi
49724981
49734982 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__" >&5
49744983 $as_echo_n "checking for __attribute__... " >&6; }
4975 if test "${ac_cv___attribute__+set}" = set; then :
4984 if ${ac_cv___attribute__+:} false; then :
49764985 $as_echo_n "(cached) " >&6
49774986 else
49784987
50165025
50175026 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -fPIC" >&5
50185027 $as_echo_n "checking if compiler supports -fPIC... " >&6; }
5019 if test "${ac_cv_fpic+set}" = set; then :
5028 if ${ac_cv_fpic+:} false; then :
50205029 $as_echo_n "(cached) " >&6
50215030 else
50225031
50645073 # CMU GUESS RUNPATH SWITCH
50655074 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for runpath switch" >&5
50665075 $as_echo_n "checking for runpath switch... " >&6; }
5067 if test "${andrew_cv_runpath_switch+set}" = set; then :
5076 if ${andrew_cv_runpath_switch+:} false; then :
50685077 $as_echo_n "(cached) " >&6
50695078 else
50705079
51295138 done
51305139
51315140 ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove"
5132 if test "x$ac_cv_func_memmove" = x""yes; then :
5141 if test "x$ac_cv_func_memmove" = xyes; then :
51335142 $as_echo "#define HAVE_MEMMOVE 1" >>confdefs.h
51345143
51355144 else
51425151 fi
51435152
51445153 ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
5145 if test "x$ac_cv_func_strcasecmp" = x""yes; then :
5154 if test "x$ac_cv_func_strcasecmp" = xyes; then :
51465155 $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h
51475156
51485157 else
51555164 fi
51565165
51575166 ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate"
5158 if test "x$ac_cv_func_ftruncate" = x""yes; then :
5167 if test "x$ac_cv_func_ftruncate" = xyes; then :
51595168 $as_echo "#define HAVE_FTRUNCATE 1" >>confdefs.h
51605169
51615170 else
51685177 fi
51695178
51705179 ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
5171 if test "x$ac_cv_func_strerror" = x""yes; then :
5180 if test "x$ac_cv_func_strerror" = xyes; then :
51725181 $as_echo "#define HAVE_STRERROR 1" >>confdefs.h
51735182
51745183 else
51985207 as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
51995208 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
52005209 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
5201 if eval "test \"\${$as_ac_Header+set}\"" = set; then :
5210 if eval \${$as_ac_Header+:} false; then :
52025211 $as_echo_n "(cached) " >&6
52035212 else
52045213 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52385247 if test $ac_header_dirent = dirent.h; then
52395248 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
52405249 $as_echo_n "checking for library containing opendir... " >&6; }
5241 if test "${ac_cv_search_opendir+set}" = set; then :
5250 if ${ac_cv_search_opendir+:} false; then :
52425251 $as_echo_n "(cached) " >&6
52435252 else
52445253 ac_func_search_save_LIBS=$LIBS
52725281 fi
52735282 rm -f core conftest.err conftest.$ac_objext \
52745283 conftest$ac_exeext
5275 if test "${ac_cv_search_opendir+set}" = set; then :
5284 if ${ac_cv_search_opendir+:} false; then :
52765285 break
52775286 fi
52785287 done
5279 if test "${ac_cv_search_opendir+set}" = set; then :
5288 if ${ac_cv_search_opendir+:} false; then :
52805289
52815290 else
52825291 ac_cv_search_opendir=no
52955304 else
52965305 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
52975306 $as_echo_n "checking for library containing opendir... " >&6; }
5298 if test "${ac_cv_search_opendir+set}" = set; then :
5307 if ${ac_cv_search_opendir+:} false; then :
52995308 $as_echo_n "(cached) " >&6
53005309 else
53015310 ac_func_search_save_LIBS=$LIBS
53295338 fi
53305339 rm -f core conftest.err conftest.$ac_objext \
53315340 conftest$ac_exeext
5332 if test "${ac_cv_search_opendir+set}" = set; then :
5341 if ${ac_cv_search_opendir+:} false; then :
53335342 break
53345343 fi
53355344 done
5336 if test "${ac_cv_search_opendir+set}" = set; then :
5345 if ${ac_cv_search_opendir+:} false; then :
53375346
53385347 else
53395348 ac_cv_search_opendir=no
53555364 for ac_header in stdlib.h
53565365 do :
53575366 ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
5358 if test "x$ac_cv_header_stdlib_h" = x""yes; then :
5367 if test "x$ac_cv_header_stdlib_h" = xyes; then :
53595368 cat >>confdefs.h <<_ACEOF
53605369 #define HAVE_STDLIB_H 1
53615370 _ACEOF
53675376 for ac_func in getpassphrase
53685377 do :
53695378 ac_fn_c_check_func "$LINENO" "getpassphrase" "ac_cv_func_getpassphrase"
5370 if test "x$ac_cv_func_getpassphrase" = x""yes; then :
5379 if test "x$ac_cv_func_getpassphrase" = xyes; then :
53715380 cat >>confdefs.h <<_ACEOF
53725381 #define HAVE_GETPASSPHRASE 1
53735382 _ACEOF
53805389 save_LIBS="$LIBS"
53815390 LIB_SOCKET=""
53825391 ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
5383 if test "x$ac_cv_func_connect" = x""yes; then :
5392 if test "x$ac_cv_func_connect" = xyes; then :
53845393 :
53855394 else
53865395 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
53875396 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
5388 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then :
5397 if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
53895398 $as_echo_n "(cached) " >&6
53905399 else
53915400 ac_check_lib_save_LIBS=$LIBS
54195428 fi
54205429 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
54215430 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
5422 if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then :
5431 if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
54235432 LIB_SOCKET="-lnsl $LIB_SOCKET"
54245433 fi
54255434
54265435 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
54275436 $as_echo_n "checking for connect in -lsocket... " >&6; }
5428 if test "${ac_cv_lib_socket_connect+set}" = set; then :
5437 if ${ac_cv_lib_socket_connect+:} false; then :
54295438 $as_echo_n "(cached) " >&6
54305439 else
54315440 ac_check_lib_save_LIBS=$LIBS
54595468 fi
54605469 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
54615470 $as_echo "$ac_cv_lib_socket_connect" >&6; }
5462 if test "x$ac_cv_lib_socket_connect" = x""yes; then :
5471 if test "x$ac_cv_lib_socket_connect" = xyes; then :
54635472 LIB_SOCKET="-lsocket $LIB_SOCKET"
54645473 fi
54655474
54685477
54695478 LIBS="$LIB_SOCKET $save_LIBS"
54705479 ac_fn_c_check_func "$LINENO" "res_search" "ac_cv_func_res_search"
5471 if test "x$ac_cv_func_res_search" = x""yes; then :
5480 if test "x$ac_cv_func_res_search" = xyes; then :
54725481 :
54735482 else
54745483 LIBS="-lresolv $LIB_SOCKET $save_LIBS"
55245533 cyrus_cv_getaddrinfo=yes
55255534
55265535 ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
5527 if test "x$ac_cv_func_getaddrinfo" = x""yes; then :
5536 if test "x$ac_cv_func_getaddrinfo" = xyes; then :
55285537 ac_cv_lib_socket_getaddrinfo=no
55295538 ac_cv_lib_inet6_getaddrinfo=no
55305539
55315540 else
55325541 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lsocket" >&5
55335542 $as_echo_n "checking for getaddrinfo in -lsocket... " >&6; }
5534 if test "${ac_cv_lib_socket_getaddrinfo+set}" = set; then :
5543 if ${ac_cv_lib_socket_getaddrinfo+:} false; then :
55355544 $as_echo_n "(cached) " >&6
55365545 else
55375546 ac_check_lib_save_LIBS=$LIBS
55655574 fi
55665575 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getaddrinfo" >&5
55675576 $as_echo "$ac_cv_lib_socket_getaddrinfo" >&6; }
5568 if test "x$ac_cv_lib_socket_getaddrinfo" = x""yes; then :
5577 if test "x$ac_cv_lib_socket_getaddrinfo" = xyes; then :
55695578 LIBS="$LIBS -lsocket"
55705579 ac_cv_lib_inet6_getaddrinfo=no
55715580
55725581 else
55735582 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system has IPv6 directory" >&5
55745583 $as_echo_n "checking whether your system has IPv6 directory... " >&6; }
5575 if test "${ipv6_cv_dir+set}" = set; then :
5584 if ${ipv6_cv_dir+:} false; then :
55765585 $as_echo_n "(cached) " >&6
55775586 else
55785587 for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
55935602 fi
55945603 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -linet6" >&5
55955604 $as_echo_n "checking for getaddrinfo in -linet6... " >&6; }
5596 if test "${ac_cv_lib_inet6_getaddrinfo+set}" = set; then :
5605 if ${ac_cv_lib_inet6_getaddrinfo+:} false; then :
55975606 $as_echo_n "(cached) " >&6
55985607 else
55995608 ac_check_lib_save_LIBS=$LIBS
56275636 fi
56285637 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet6_getaddrinfo" >&5
56295638 $as_echo "$ac_cv_lib_inet6_getaddrinfo" >&6; }
5630 if test "x$ac_cv_lib_inet6_getaddrinfo" = x""yes; then :
5639 if test "x$ac_cv_lib_inet6_getaddrinfo" = xyes; then :
56315640 if test $ipv6_libinet6 = no; then
56325641 ipv6_libinet6=yes
56335642 LIBS="$LIBS -linet6"
56785687 if test $ipv6_cv_getaddrinfo = yes; then
56795688
56805689 ac_fn_c_check_func "$LINENO" "gai_strerror" "ac_cv_func_gai_strerror"
5681 if test "x$ac_cv_func_gai_strerror" = x""yes; then :
5690 if test "x$ac_cv_func_gai_strerror" = xyes; then :
56825691 ac_cv_lib_socket_gai_strerror=no
56835692 ac_cv_lib_inet6_gai_strerror=no
56845693
56855694 else
56865695 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gai_strerror in -lsocket" >&5
56875696 $as_echo_n "checking for gai_strerror in -lsocket... " >&6; }
5688 if test "${ac_cv_lib_socket_gai_strerror+set}" = set; then :
5697 if ${ac_cv_lib_socket_gai_strerror+:} false; then :
56895698 $as_echo_n "(cached) " >&6
56905699 else
56915700 ac_check_lib_save_LIBS=$LIBS
57195728 fi
57205729 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gai_strerror" >&5
57215730 $as_echo "$ac_cv_lib_socket_gai_strerror" >&6; }
5722 if test "x$ac_cv_lib_socket_gai_strerror" = x""yes; then :
5731 if test "x$ac_cv_lib_socket_gai_strerror" = xyes; then :
57235732 LIBS="$LIBS -lsocket"
57245733 ac_cv_lib_inet6_gai_strerror=no
57255734
57265735 else
57275736 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system has IPv6 directory" >&5
57285737 $as_echo_n "checking whether your system has IPv6 directory... " >&6; }
5729 if test "${ipv6_cv_dir+set}" = set; then :
5738 if ${ipv6_cv_dir+:} false; then :
57305739 $as_echo_n "(cached) " >&6
57315740 else
57325741 for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
57475756 fi
57485757 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gai_strerror in -linet6" >&5
57495758 $as_echo_n "checking for gai_strerror in -linet6... " >&6; }
5750 if test "${ac_cv_lib_inet6_gai_strerror+set}" = set; then :
5759 if ${ac_cv_lib_inet6_gai_strerror+:} false; then :
57515760 $as_echo_n "(cached) " >&6
57525761 else
57535762 ac_check_lib_save_LIBS=$LIBS
57815790 fi
57825791 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet6_gai_strerror" >&5
57835792 $as_echo "$ac_cv_lib_inet6_gai_strerror" >&6; }
5784 if test "x$ac_cv_lib_inet6_gai_strerror" = x""yes; then :
5793 if test "x$ac_cv_lib_inet6_gai_strerror" = xyes; then :
57855794 if test $ipv6_libinet6 = no; then
57865795 ipv6_libinet6=yes
57875796 LIBS="$LIBS -linet6"
58475856 cyrus_cv_getnameinfo=yes
58485857
58495858 ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo"
5850 if test "x$ac_cv_func_getnameinfo" = x""yes; then :
5859 if test "x$ac_cv_func_getnameinfo" = xyes; then :
58515860 ac_cv_lib_socket_getnameinfo=no
58525861 ac_cv_lib_inet6_getnameinfo=no
58535862
58545863 else
58555864 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lsocket" >&5
58565865 $as_echo_n "checking for getnameinfo in -lsocket... " >&6; }
5857 if test "${ac_cv_lib_socket_getnameinfo+set}" = set; then :
5866 if ${ac_cv_lib_socket_getnameinfo+:} false; then :
58585867 $as_echo_n "(cached) " >&6
58595868 else
58605869 ac_check_lib_save_LIBS=$LIBS
58885897 fi
58895898 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getnameinfo" >&5
58905899 $as_echo "$ac_cv_lib_socket_getnameinfo" >&6; }
5891 if test "x$ac_cv_lib_socket_getnameinfo" = x""yes; then :
5900 if test "x$ac_cv_lib_socket_getnameinfo" = xyes; then :
58925901 LIBS="$LIBS -lsocket"
58935902 ac_cv_lib_inet6_getnameinfo=no
58945903
58955904 else
58965905 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system has IPv6 directory" >&5
58975906 $as_echo_n "checking whether your system has IPv6 directory... " >&6; }
5898 if test "${ipv6_cv_dir+set}" = set; then :
5907 if ${ipv6_cv_dir+:} false; then :
58995908 $as_echo_n "(cached) " >&6
59005909 else
59015910 for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
59165925 fi
59175926 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -linet6" >&5
59185927 $as_echo_n "checking for getnameinfo in -linet6... " >&6; }
5919 if test "${ac_cv_lib_inet6_getnameinfo+set}" = set; then :
5928 if ${ac_cv_lib_inet6_getnameinfo+:} false; then :
59205929 $as_echo_n "(cached) " >&6
59215930 else
59225931 ac_check_lib_save_LIBS=$LIBS
59505959 fi
59515960 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet6_getnameinfo" >&5
59525961 $as_echo "$ac_cv_lib_inet6_getnameinfo" >&6; }
5953 if test "x$ac_cv_lib_inet6_getnameinfo" = x""yes; then :
5962 if test "x$ac_cv_lib_inet6_getnameinfo" = xyes; then :
59545963 if test $ipv6_libinet6 = no; then
59555964 ipv6_libinet6=yes
59565965 LIBS="$LIBS -linet6"
60136022
60146023 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether you have ss_family in struct sockaddr_storage" >&5
60156024 $as_echo_n "checking whether you have ss_family in struct sockaddr_storage... " >&6; }
6016 if test "${ipv6_cv_ss_family+set}" = set; then :
6025 if ${ipv6_cv_ss_family+:} false; then :
60176026 $as_echo_n "(cached) " >&6
60186027 else
60196028 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60476056
60486057 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether you have sa_len in struct sockaddr" >&5
60496058 $as_echo_n "checking whether you have sa_len in struct sockaddr... " >&6; }
6050 if test "${ipv6_cv_sa_len+set}" = set; then :
6059 if ${ipv6_cv_sa_len+:} false; then :
60516060 $as_echo_n "(cached) " >&6
60526061 else
60536062 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60846093 for ac_header in sys/time.h
60856094 do :
60866095 ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default"
6087 if test "x$ac_cv_header_sys_time_h" = x""yes; then :
6096 if test "x$ac_cv_header_sys_time_h" = xyes; then :
60886097 cat >>confdefs.h <<_ACEOF
60896098 #define HAVE_SYS_TIME_H 1
60906099 _ACEOF
60956104
60966105 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
60976106 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
6098 if test "${ac_cv_header_time+set}" = set; then :
6107 if ${ac_cv_header_time+:} false; then :
60996108 $as_echo_n "(cached) " >&6
61006109 else
61016110 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61306139
61316140 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
61326141 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
6133 if test "${ac_cv_struct_tm+set}" = set; then :
6142 if ${ac_cv_struct_tm+:} false; then :
61346143 $as_echo_n "(cached) " >&6
61356144 else
61366145 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61676176 #include <$ac_cv_struct_tm>
61686177
61696178 "
6170 if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
6179 if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
61716180
61726181 cat >>confdefs.h <<_ACEOF
61736182 #define HAVE_STRUCT_TM_TM_ZONE 1
61836192 else
61846193 ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h>
61856194 "
6186 if test "x$ac_cv_have_decl_tzname" = x""yes; then :
6195 if test "x$ac_cv_have_decl_tzname" = xyes; then :
61876196 ac_have_decl=1
61886197 else
61896198 ac_have_decl=0
61956204
61966205 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
61976206 $as_echo_n "checking for tzname... " >&6; }
6198 if test "${ac_cv_var_tzname+set}" = set; then :
6207 if ${ac_cv_var_tzname+:} false; then :
61996208 $as_echo_n "(cached) " >&6
62006209 else
62016210 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62396248 for ac_func in vprintf
62406249 do :
62416250 ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
6242 if test "x$ac_cv_func_vprintf" = x""yes; then :
6251 if test "x$ac_cv_func_vprintf" = xyes; then :
62436252 cat >>confdefs.h <<_ACEOF
62446253 #define HAVE_VPRINTF 1
62456254 _ACEOF
62466255
62476256 ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
6248 if test "x$ac_cv_func__doprnt" = x""yes; then :
6257 if test "x$ac_cv_func__doprnt" = xyes; then :
62496258
62506259 $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
62516260
63256334 fi
63266335
63276336 ac_fn_c_check_header_mongrel "$LINENO" "db.h" "ac_cv_header_db_h" "$ac_includes_default"
6328 if test "x$ac_cv_header_db_h" = x""yes; then :
6337 if test "x$ac_cv_header_db_h" = xyes; then :
63296338
63306339 BDB_SAVE_LDFLAGS=$LDFLAGS
63316340
65176526 fi
65186527
65196528 ac_fn_c_check_header_mongrel "$LINENO" "mysql.h" "ac_cv_header_mysql_h" "$ac_includes_default"
6520 if test "x$ac_cv_header_mysql_h" = x""yes; then :
6529 if test "x$ac_cv_header_mysql_h" = xyes; then :
65216530
65226531 MYSQL_SAVE_LDFLAGS=$LDFLAGS
65236532
66666675 fi
66676676
66686677 ac_fn_c_check_header_mongrel "$LINENO" "libpq-fe.h" "ac_cv_header_libpq_fe_h" "$ac_includes_default"
6669 if test "x$ac_cv_header_libpq_fe_h" = x""yes; then :
6678 if test "x$ac_cv_header_libpq_fe_h" = xyes; then :
66706679
66716680 PGSQL_SAVE_LDFLAGS=$LDFLAGS
66726681
68156824 fi
68166825
68176826 ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default"
6818 if test "x$ac_cv_header_sqlite3_h" = x""yes; then :
6827 if test "x$ac_cv_header_sqlite3_h" = xyes; then :
68196828
68206829 SQLITE_SAVE_LDFLAGS=$LDFLAGS
68216830
69496958 set dummy $ac_prog; ac_word=$2
69506959 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
69516960 $as_echo_n "checking for $ac_word... " >&6; }
6952 if test "${ac_cv_prog_YACC+set}" = set; then :
6961 if ${ac_cv_prog_YACC+:} false; then :
69536962 $as_echo_n "(cached) " >&6
69546963 else
69556964 if test -n "$YACC"; then
69927001 set dummy $ac_prog; ac_word=$2
69937002 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
69947003 $as_echo_n "checking for $ac_word... " >&6; }
6995 if test "${ac_cv_prog_LEX+set}" = set; then :
7004 if ${ac_cv_prog_LEX+:} false; then :
69967005 $as_echo_n "(cached) " >&6
69977006 else
69987007 if test -n "$LEX"; then
70627071 test $ac_status = 0; }
70637072 { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5
70647073 $as_echo_n "checking lex output file root... " >&6; }
7065 if test "${ac_cv_prog_lex_root+set}" = set; then :
7074 if ${ac_cv_prog_lex_root+:} false; then :
70667075 $as_echo_n "(cached) " >&6
70677076 else
70687077
70817090 if test -z "${LEXLIB+set}"; then
70827091 { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5
70837092 $as_echo_n "checking lex library... " >&6; }
7084 if test "${ac_cv_lib_lex+set}" = set; then :
7093 if ${ac_cv_lib_lex+:} false; then :
70857094 $as_echo_n "(cached) " >&6
70867095 else
70877096
71117120
71127121 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5
71137122 $as_echo_n "checking whether yytext is a pointer... " >&6; }
7114 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then :
7123 if ${ac_cv_prog_lex_yytext_pointer+:} false; then :
71157124 $as_echo_n "(cached) " >&6
71167125 else
71177126 # POSIX says lex can declare yytext either as a pointer or an array; the
71227131 LIBS="$LEXLIB $ac_save_LIBS"
71237132 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
71247133 /* end confdefs.h. */
7125 #define YYTEXT_POINTER 1
7134
7135 #define YYTEXT_POINTER 1
71267136 `cat $LEX_OUTPUT_ROOT.c`
71277137 _ACEOF
71287138 if ac_fn_c_try_link "$LINENO"; then :
71457155 fi
71467156 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lfl" >&5
71477157 $as_echo_n "checking for main in -lfl... " >&6; }
7148 if test "${ac_cv_lib_fl_main+set}" = set; then :
7158 if ${ac_cv_lib_fl_main+:} false; then :
71497159 $as_echo_n "(cached) " >&6
71507160 else
71517161 ac_check_lib_save_LIBS=$LIBS
71737183 fi
71747184 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fl_main" >&5
71757185 $as_echo "$ac_cv_lib_fl_main" >&6; }
7176 if test "x$ac_cv_lib_fl_main" = x""yes; then :
7186 if test "x$ac_cv_lib_fl_main" = xyes; then :
71777187 cat >>confdefs.h <<_ACEOF
71787188 #define HAVE_LIBFL 1
71797189 _ACEOF
71857195
71867196 if test "$testpcre" != "no"; then
71877197 ac_fn_c_check_header_mongrel "$LINENO" "pcreposix.h" "ac_cv_header_pcreposix_h" "$ac_includes_default"
7188 if test "x$ac_cv_header_pcreposix_h" = x""yes; then :
7198 if test "x$ac_cv_header_pcreposix_h" = xyes; then :
71897199
71907200 fi
71917201
71937203 if test "$ac_cv_header_pcreposix_h" == "yes"; then
71947204 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for utf8 enabled pcre" >&5
71957205 $as_echo_n "checking for utf8 enabled pcre... " >&6; }
7196 if test "${cyrus_cv_pcre_utf8+set}" = set; then :
7206 if ${cyrus_cv_pcre_utf8+:} false; then :
71977207 $as_echo_n "(cached) " >&6
71987208 else
71997209 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
72307240 for ac_header in rxposix.h
72317241 do :
72327242 ac_fn_c_check_header_mongrel "$LINENO" "rxposix.h" "ac_cv_header_rxposix_h" "$ac_includes_default"
7233 if test "x$ac_cv_header_rxposix_h" = x""yes; then :
7243 if test "x$ac_cv_header_rxposix_h" = xyes; then :
72347244 cat >>confdefs.h <<_ACEOF
72357245 #define HAVE_RXPOSIX_H 1
72367246 _ACEOF
72477257 else
72487258 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing regcomp" >&5
72497259 $as_echo_n "checking for library containing regcomp... " >&6; }
7250 if test "${ac_cv_search_regcomp+set}" = set; then :
7260 if ${ac_cv_search_regcomp+:} false; then :
72517261 $as_echo_n "(cached) " >&6
72527262 else
72537263 ac_func_search_save_LIBS=$LIBS
72817291 fi
72827292 rm -f core conftest.err conftest.$ac_objext \
72837293 conftest$ac_exeext
7284 if test "${ac_cv_search_regcomp+set}" = set; then :
7294 if ${ac_cv_search_regcomp+:} false; then :
72857295 break
72867296 fi
72877297 done
7288 if test "${ac_cv_search_regcomp+set}" = set; then :
7298 if ${ac_cv_search_regcomp+:} false; then :
72897299
72907300 else
72917301 ac_cv_search_regcomp=no
73137323
73147324
73157325 ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
7316 if test "x$ac_cv_func_strerror" = x""yes; then :
7326 if test "x$ac_cv_func_strerror" = xyes; then :
73177327
73187328 $as_echo "#define HAS_STRERROR /**/" >>confdefs.h
73197329
73277337 for ac_header in sys/resource.h
73287338 do :
73297339 ac_fn_c_check_header_mongrel "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"
7330 if test "x$ac_cv_header_sys_resource_h" = x""yes; then :
7340 if test "x$ac_cv_header_sys_resource_h" = xyes; then :
73317341 cat >>confdefs.h <<_ACEOF
73327342 #define HAVE_SYS_RESOURCE_H 1
73337343 _ACEOF
73397349 for ac_func in setrlimit
73407350 do :
73417351 ac_fn_c_check_func "$LINENO" "setrlimit" "ac_cv_func_setrlimit"
7342 if test "x$ac_cv_func_setrlimit" = x""yes; then :
7352 if test "x$ac_cv_func_setrlimit" = xyes; then :
73437353 cat >>confdefs.h <<_ACEOF
73447354 #define HAVE_SETRLIMIT 1
73457355 _ACEOF
73507360 for ac_func in getrlimit
73517361 do :
73527362 ac_fn_c_check_func "$LINENO" "getrlimit" "ac_cv_func_getrlimit"
7353 if test "x$ac_cv_func_getrlimit" = x""yes; then :
7363 if test "x$ac_cv_func_getrlimit" = xyes; then :
73547364 cat >>confdefs.h <<_ACEOF
73557365 #define HAVE_GETRLIMIT 1
73567366 _ACEOF
73757385 for ac_func in shutdown
73767386 do :
73777387 ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
7378 if test "x$ac_cv_func_shutdown" = x""yes; then :
7388 if test "x$ac_cv_func_shutdown" = xyes; then :
73797389 cat >>confdefs.h <<_ACEOF
73807390 #define HAVE_SHUTDOWN 1
73817391 _ACEOF
74267436
74277437 spt_type=""
74287438 ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle"
7429 if test "x$ac_cv_func_setproctitle" = x""yes; then :
7439 if test "x$ac_cv_func_setproctitle" = xyes; then :
74307440 spt_type=SPT_BUILTIN
74317441 fi
74327442
74337443 if test "$spt_type" = ""; then
74347444 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setproctitle in -lutil" >&5
74357445 $as_echo_n "checking for setproctitle in -lutil... " >&6; }
7436 if test "${ac_cv_lib_util_setproctitle+set}" = set; then :
7446 if ${ac_cv_lib_util_setproctitle+:} false; then :
74377447 $as_echo_n "(cached) " >&6
74387448 else
74397449 ac_check_lib_save_LIBS=$LIBS
74677477 fi
74687478 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_setproctitle" >&5
74697479 $as_echo "$ac_cv_lib_util_setproctitle" >&6; }
7470 if test "x$ac_cv_lib_util_setproctitle" = x""yes; then :
7480 if test "x$ac_cv_lib_util_setproctitle" = xyes; then :
74717481 spt_type=SPT_BUILTIN
74727482 LIBS="${LIBS} -lutil"
74737483 fi
74757485 fi
74767486 if test "$spt_type" = ""; then
74777487 ac_fn_c_check_header_mongrel "$LINENO" "sys/pstat.h" "ac_cv_header_sys_pstat_h" "$ac_includes_default"
7478 if test "x$ac_cv_header_sys_pstat_h" = x""yes; then :
7488 if test "x$ac_cv_header_sys_pstat_h" = xyes; then :
74797489 spt_type=SPT_PSTAT
74807490 fi
74817491
74837493 fi
74847494 if test "$spt_type" = ""; then
74857495 ac_fn_c_check_header_mongrel "$LINENO" "sys/sysnews.h" "ac_cv_header_sys_sysnews_h" "$ac_includes_default"
7486 if test "x$ac_cv_header_sys_sysnews_h" = x""yes; then :
7496 if test "x$ac_cv_header_sys_sysnews_h" = xyes; then :
74877497 spt_type=SPT_SYSMIPS
74887498 fi
74897499
74927502 if test "$spt_type" = ""; then
74937503 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
74947504 $as_echo_n "checking for PS_STRINGS... " >&6; }
7495 if test "${cyrus_cv_sys_psstrings+set}" = set; then :
7505 if ${cyrus_cv_sys_psstrings+:} false; then :
74967506 $as_echo_n "(cached) " >&6
74977507 else
74987508 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
75217531 if test "$spt_type" = ""; then
75227532 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SCO" >&5
75237533 $as_echo_n "checking for SCO... " >&6; }
7524 if test "${cyrus_cv_sys_sco+set}" = set; then :
7534 if ${cyrus_cv_sys_sco+:} false; then :
75257535 $as_echo_n "(cached) " >&6
75267536 else
75277537 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
75487558 if test "$spt_type" = ""; then
75497559 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setproctitle usability" >&5
75507560 $as_echo_n "checking for setproctitle usability... " >&6; }
7551 if test "${cyrus_cv_sys_setproctitle+set}" = set; then :
7561 if ${cyrus_cv_sys_setproctitle+:} false; then :
75527562 $as_echo_n "(cached) " >&6
75537563 else
75547564 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
75827592
75837593 { $as_echo "$as_me:${as_lineno-$LINENO}: checking nonblocking method" >&5
75847594 $as_echo_n "checking nonblocking method... " >&6; }
7585 if test "${cyrus_cv_sys_nonblock+set}" = set; then :
7595 if ${cyrus_cv_sys_nonblock+:} false; then :
75867596 $as_echo_n "(cached) " >&6
75877597 else
75887598 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
76177627
76187628 { $as_echo "$as_me:${as_lineno-$LINENO}: checking timezone GMT offset method" >&5
76197629 $as_echo_n "checking timezone GMT offset method... " >&6; }
7620 if test "${cyrus_cv_struct_sys_gmtoff+set}" = set; then :
7630 if ${cyrus_cv_struct_sys_gmtoff+:} false; then :
76217631 $as_echo_n "(cached) " >&6
76227632 else
76237633 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
76487658 $as_echo "$WITH_GMTOFF" >&6; }
76497659 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared mmap" >&5
76507660 $as_echo_n "checking for shared mmap... " >&6; }
7651 if test "${cyrus_cv_func_mmap_shared+set}" = set; then :
7661 if ${cyrus_cv_func_mmap_shared+:} false; then :
76527662 $as_echo_n "(cached) " >&6
76537663 else
76547664 if test "$cross_compiling" = yes; then :
77007710 else
77017711 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stupid shared mmap" >&5
77027712 $as_echo_n "checking for stupid shared mmap... " >&6; }
7703 if test "${cyrus_cv_func_mmap_stupidshared+set}" = set; then :
7713 if ${cyrus_cv_func_mmap_stupidshared+:} false; then :
77047714 $as_echo_n "(cached) " >&6
77057715 else
77067716 if test "$cross_compiling" = yes; then :
77677777 else
77687778
77697779 ac_fn_c_check_func "$LINENO" "fcntl" "ac_cv_func_fcntl"
7770 if test "x$ac_cv_func_fcntl" = x""yes; then :
7780 if test "x$ac_cv_func_fcntl" = xyes; then :
77717781 WITH_LOCK="fcntl"
77727782 else
77737783
77747784 ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock"
7775 if test "x$ac_cv_func_flock" = x""yes; then :
7785 if test "x$ac_cv_func_flock" = xyes; then :
77767786 WITH_LOCK="flock"
77777787 else
77787788
77917801
77927802 LIB_RT=""
77937803 ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync"
7794 if test "x$ac_cv_func_fdatasync" = x""yes; then :
7804 if test "x$ac_cv_func_fdatasync" = xyes; then :
77957805
77967806 $as_echo "#define HAVE_FDATASYNC /**/" >>confdefs.h
77977807
77997809
78007810 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fdatasync in -lrt" >&5
78017811 $as_echo_n "checking for fdatasync in -lrt... " >&6; }
7802 if test "${ac_cv_lib_rt_fdatasync+set}" = set; then :
7812 if ${ac_cv_lib_rt_fdatasync+:} false; then :
78037813 $as_echo_n "(cached) " >&6
78047814 else
78057815 ac_check_lib_save_LIBS=$LIBS
78337843 fi
78347844 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_fdatasync" >&5
78357845 $as_echo "$ac_cv_lib_rt_fdatasync" >&6; }
7836 if test "x$ac_cv_lib_rt_fdatasync" = x""yes; then :
7846 if test "x$ac_cv_lib_rt_fdatasync" = xyes; then :
78377847
78387848 LIB_RT="-lrt"
78397849
78477857
78487858
78497859 cant_find_sigvec=no
7850 if test "${cyrus_cv_sigveclib+set}" = set; then :
7860 if ${cyrus_cv_sigveclib+:} false; then :
78517861 $as_echo_n "(cached) " >&6
78527862 else
78537863
78547864 ac_fn_c_check_func "$LINENO" "sigvec" "ac_cv_func_sigvec"
7855 if test "x$ac_cv_func_sigvec" = x""yes; then :
7865 if test "x$ac_cv_func_sigvec" = xyes; then :
78567866
78577867 cyrus_cv_sigveclib=""
78587868
78607870
78617871 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigvec in -lBSD" >&5
78627872 $as_echo_n "checking for sigvec in -lBSD... " >&6; }
7863 if test "${ac_cv_lib_BSD_sigvec+set}" = set; then :
7873 if ${ac_cv_lib_BSD_sigvec+:} false; then :
78647874 $as_echo_n "(cached) " >&6
78657875 else
78667876 ac_check_lib_save_LIBS=$LIBS
78947904 fi
78957905 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_BSD_sigvec" >&5
78967906 $as_echo "$ac_cv_lib_BSD_sigvec" >&6; }
7897 if test "x$ac_cv_lib_BSD_sigvec" = x""yes; then :
7907 if test "x$ac_cv_lib_BSD_sigvec" = xyes; then :
78987908 cyrus_cv_sigveclib="-lBSD"
78997909 else
79007910
79027912 LDFLAGS="-L/usr/ucblib -R/usr/ucblib $LDFLAGS"
79037913 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigvec in -lucb" >&5
79047914 $as_echo_n "checking for sigvec in -lucb... " >&6; }
7905 if test "${ac_cv_lib_ucb_sigvec+set}" = set; then :
7915 if ${ac_cv_lib_ucb_sigvec+:} false; then :
79067916 $as_echo_n "(cached) " >&6
79077917 else
79087918 ac_check_lib_save_LIBS=$LIBS
79367946 fi
79377947 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ucb_sigvec" >&5
79387948 $as_echo "$ac_cv_lib_ucb_sigvec" >&6; }
7939 if test "x$ac_cv_lib_ucb_sigvec" = x""yes; then :
7949 if test "x$ac_cv_lib_ucb_sigvec" = xyes; then :
79407950
79417951 cyrus_cv_sigveclib="-lc -L/usr/ucblib -R/usr/ucblib -lucb"
79427952 else
80288038 AFS_LIBS="$AFS_LIBS -ldes"
80298039 fi
80308040
8031 if test "${cyrus_cv_afs_sigvec+set}" = set; then :
8041 if ${cyrus_cv_afs_sigvec+:} false; then :
80328042 $as_echo_n "(cached) " >&6
80338043 else
80348044
81088118
81098119 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap" >&5
81108120 $as_echo_n "checking for ldap_initialize in -lldap... " >&6; }
8111 if test "${ac_cv_lib_ldap_ldap_initialize+set}" = set; then :
8121 if ${ac_cv_lib_ldap_ldap_initialize+:} false; then :
81128122 $as_echo_n "(cached) " >&6
81138123 else
81148124 ac_check_lib_save_LIBS=$LIBS
81428152 fi
81438153 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_initialize" >&5
81448154 $as_echo "$ac_cv_lib_ldap_ldap_initialize" >&6; }
8145 if test "x$ac_cv_lib_ldap_ldap_initialize" = x""yes; then :
8155 if test "x$ac_cv_lib_ldap_ldap_initialize" = xyes; then :
81468156
81478157 $as_echo "#define HAVE_LDAP /**/" >>confdefs.h
81488158
81588168
81598169 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap" >&5
81608170 $as_echo_n "checking for ldap_initialize in -lldap... " >&6; }
8161 if test "${ac_cv_lib_ldap_ldap_initialize+set}" = set; then :
8171 if ${ac_cv_lib_ldap_ldap_initialize+:} false; then :
81628172 $as_echo_n "(cached) " >&6
81638173 else
81648174 ac_check_lib_save_LIBS=$LIBS
81928202 fi
81938203 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_initialize" >&5
81948204 $as_echo "$ac_cv_lib_ldap_ldap_initialize" >&6; }
8195 if test "x$ac_cv_lib_ldap_ldap_initialize" = x""yes; then :
8205 if test "x$ac_cv_lib_ldap_ldap_initialize" = xyes; then :
81968206
81978207 $as_echo "#define HAVE_LDAP /**/" >>confdefs.h
81988208
82588268
82598269 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5
82608270 $as_echo_n "checking for res_search in -lresolv... " >&6; }
8261 if test "${ac_cv_lib_resolv_res_search+set}" = set; then :
8271 if ${ac_cv_lib_resolv_res_search+:} false; then :
82628272 $as_echo_n "(cached) " >&6
82638273 else
82648274 ac_check_lib_save_LIBS=$LIBS
82928302 fi
82938303 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5
82948304 $as_echo "$ac_cv_lib_resolv_res_search" >&6; }
8295 if test "x$ac_cv_lib_resolv_res_search" = x""yes; then :
8305 if test "x$ac_cv_lib_resolv_res_search" = xyes; then :
82968306 cat >>confdefs.h <<_ACEOF
82978307 #define HAVE_LIBRESOLV 1
82988308 _ACEOF
83188328 if test "$with_krbdes" = "yes"; then
83198329 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_ecb_encrypt in -ldes" >&5
83208330 $as_echo_n "checking for des_ecb_encrypt in -ldes... " >&6; }
8321 if test "${ac_cv_lib_des_des_ecb_encrypt+set}" = set; then :
8331 if ${ac_cv_lib_des_des_ecb_encrypt+:} false; then :
83228332 $as_echo_n "(cached) " >&6
83238333 else
83248334 ac_check_lib_save_LIBS=$LIBS
83528362 fi
83538363 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des_des_ecb_encrypt" >&5
83548364 $as_echo "$ac_cv_lib_des_des_ecb_encrypt" >&6; }
8355 if test "x$ac_cv_lib_des_des_ecb_encrypt" = x""yes; then :
8365 if test "x$ac_cv_lib_des_des_ecb_encrypt" = xyes; then :
83568366 if test "$with_statickrb" = "yes"; then
83578367 KRB_LIBS="$with_krb/lib/libdes.a"
83588368 else
83688378 if test -d ${with_krb}; then
83698379 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kerberos includes" >&5
83708380 $as_echo_n "checking for Kerberos includes... " >&6; }
8371 if test "${cyrus_cv_krbinclude+set}" = set; then :
8381 if ${cyrus_cv_krbinclude+:} false; then :
83728382 $as_echo_n "(cached) " >&6
83738383 else
83748384
84058415
84068416 if test "$with_des" != no; then
84078417 ac_fn_c_check_header_mongrel "$LINENO" "krb.h" "ac_cv_header_krb_h" "$ac_includes_default"
8408 if test "x$ac_cv_header_krb_h" = x""yes; then :
8418 if test "x$ac_cv_header_krb_h" = xyes; then :
84098419 as_ac_Lib=`$as_echo "ac_cv_lib_${KRBLIB}''_krb_mk_priv" | $as_tr_sh`
84108420 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_mk_priv in -l${KRBLIB}" >&5
84118421 $as_echo_n "checking for krb_mk_priv in -l${KRBLIB}... " >&6; }
8412 if eval "test \"\${$as_ac_Lib+set}\"" = set; then :
8422 if eval \${$as_ac_Lib+:} false; then :
84138423 $as_echo_n "(cached) " >&6
84148424 else
84158425 ac_check_lib_save_LIBS=$LIBS
84948504 LIB_RSAREF=""
84958505 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RSAPublicEncrypt in -lrsaref" >&5
84968506 $as_echo_n "checking for RSAPublicEncrypt in -lrsaref... " >&6; }
8497 if test "${ac_cv_lib_rsaref_RSAPublicEncrypt+set}" = set; then :
8507 if ${ac_cv_lib_rsaref_RSAPublicEncrypt+:} false; then :
84988508 $as_echo_n "(cached) " >&6
84998509 else
85008510 ac_check_lib_save_LIBS=$LIBS
85288538 fi
85298539 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rsaref_RSAPublicEncrypt" >&5
85308540 $as_echo "$ac_cv_lib_rsaref_RSAPublicEncrypt" >&6; }
8531 if test "x$ac_cv_lib_rsaref_RSAPublicEncrypt" = x""yes; then :
8541 if test "x$ac_cv_lib_rsaref_RSAPublicEncrypt" = xyes; then :
85328542 LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes
85338543 else
85348544 cmu_have_rsaref=no
85388548 with_openssl="yes"
85398549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIO_accept in -lcrypto" >&5
85408550 $as_echo_n "checking for BIO_accept in -lcrypto... " >&6; }
8541 if test "${ac_cv_lib_crypto_BIO_accept+set}" = set; then :
8551 if ${ac_cv_lib_crypto_BIO_accept+:} false; then :
85428552 $as_echo_n "(cached) " >&6
85438553 else
85448554 ac_check_lib_save_LIBS=$LIBS
85728582 fi
85738583 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_BIO_accept" >&5
85748584 $as_echo "$ac_cv_lib_crypto_BIO_accept" >&6; }
8575 if test "x$ac_cv_lib_crypto_BIO_accept" = x""yes; then :
8585 if test "x$ac_cv_lib_crypto_BIO_accept" = xyes; then :
85768586 LIBS="-lcrypto $LIB_RSAREF ${LIBS}"
85778587 else
85788588 with_openssl="no"
85808590
85818591 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5
85828592 $as_echo_n "checking for SSL_CTX_new in -lssl... " >&6; }
8583 if test "${ac_cv_lib_ssl_SSL_CTX_new+set}" = set; then :
8593 if ${ac_cv_lib_ssl_SSL_CTX_new+:} false; then :
85848594 $as_echo_n "(cached) " >&6
85858595 else
85868596 ac_check_lib_save_LIBS=$LIBS
86148624 fi
86158625 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5
86168626 $as_echo "$ac_cv_lib_ssl_SSL_CTX_new" >&6; }
8617 if test "x$ac_cv_lib_ssl_SSL_CTX_new" = x""yes; then :
8627 if test "x$ac_cv_lib_ssl_SSL_CTX_new" = xyes; then :
86188628 LIBS="-lssl ${LIBS}"
86198629 else
86208630 with_openssl="no"
86948704 # This bug is HP SR number 8606223364.
86958705 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
86968706 $as_echo_n "checking size of long... " >&6; }
8697 if test "${ac_cv_sizeof_long+set}" = set; then :
8707 if ${ac_cv_sizeof_long+:} false; then :
86988708 $as_echo_n "(cached) " >&6
86998709 else
87008710 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
87048714 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
87058715 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
87068716 as_fn_error 77 "cannot compute sizeof (long)
8707 See \`config.log' for more details" "$LINENO" 5 ; }
8717 See \`config.log' for more details" "$LINENO" 5; }
87088718 else
87098719 ac_cv_sizeof_long=0
87108720 fi
87238733
87248734 { $as_echo "$as_me:${as_lineno-$LINENO}: checking what directory libraries are found in" >&5
87258735 $as_echo_n "checking what directory libraries are found in... " >&6; }
8726 if test "${ac_cv_cmu_lib_subdir+set}" = set; then :
8736 if ${ac_cv_cmu_lib_subdir+:} false; then :
87278737 $as_echo_n "(cached) " >&6
87288738 else
87298739 test "X$with_lib_subdir" = "Xyes" && with_lib_subdir=
87778787 with_zlib="no";;
87788788 *)
87798789 ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
8780 if test "x$ac_cv_header_zlib_h" = x""yes; then :
8790 if test "x$ac_cv_header_zlib_h" = xyes; then :
87818791
87828792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5
87838793 $as_echo_n "checking for deflate in -lz... " >&6; }
8784 if test "${ac_cv_lib_z_deflate+set}" = set; then :
8794 if ${ac_cv_lib_z_deflate+:} false; then :
87858795 $as_echo_n "(cached) " >&6
87868796 else
87878797 ac_check_lib_save_LIBS=$LIBS
88158825 fi
88168826 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5
88178827 $as_echo "$ac_cv_lib_z_deflate" >&6; }
8818 if test "x$ac_cv_lib_z_deflate" = x""yes; then :
8828 if test "x$ac_cv_lib_z_deflate" = xyes; then :
88198829 LIBS="${LIBS} -lz"; with_zlib="yes"
88208830 else
88218831 with_zlib="no"
88648874 no) true;;
88658875 ""|yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZInitialize in -lzephyr" >&5
88668876 $as_echo_n "checking for ZInitialize in -lzephyr... " >&6; }
8867 if test "${ac_cv_lib_zephyr_ZInitialize+set}" = set; then :
8877 if ${ac_cv_lib_zephyr_ZInitialize+:} false; then :
88688878 $as_echo_n "(cached) " >&6
88698879 else
88708880 ac_check_lib_save_LIBS=$LIBS
88988908 fi
88998909 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zephyr_ZInitialize" >&5
89008910 $as_echo "$ac_cv_lib_zephyr_ZInitialize" >&6; }
8901 if test "x$ac_cv_lib_zephyr_ZInitialize" = x""yes; then :
8911 if test "x$ac_cv_lib_zephyr_ZInitialize" = xyes; then :
89028912 ZEPHYR_LIBS="-lzephyr"
89038913 else
89048914 with_zephyr="no"
89658975 for ac_header in sys/sockio.h
89668976 do :
89678977 ac_fn_c_check_header_mongrel "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default"
8968 if test "x$ac_cv_header_sys_sockio_h" = x""yes; then :
8978 if test "x$ac_cv_header_sys_sockio_h" = xyes; then :
89698979 cat >>confdefs.h <<_ACEOF
89708980 #define HAVE_SYS_SOCKIO_H 1
89718981 _ACEOF
89989008 # no value supplied
89999009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for com_err in -lcom_err" >&5
90009010 $as_echo_n "checking for com_err in -lcom_err... " >&6; }
9001 if test "${ac_cv_lib_com_err_com_err+set}" = set; then :
9011 if ${ac_cv_lib_com_err_com_err+:} false; then :
90029012 $as_echo_n "(cached) " >&6
90039013 else
90049014 ac_check_lib_save_LIBS=$LIBS
90329042 fi
90339043 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_com_err_com_err" >&5
90349044 $as_echo "$ac_cv_lib_com_err_com_err" >&6; }
9035 if test "x$ac_cv_lib_com_err_com_err" = x""yes; then :
9045 if test "x$ac_cv_lib_com_err_com_err" = xyes; then :
90369046
90379047 # com_err is already in library path
90389048 # guess we're okay
90399049 # can use system com_err
90409050 with_com_err=""
90419051 ac_fn_c_check_header_mongrel "$LINENO" "et/com_err.h" "ac_cv_header_et_com_err_h" "$ac_includes_default"
9042 if test "x$ac_cv_header_et_com_err_h" = x""yes; then :
9052 if test "x$ac_cv_header_et_com_err_h" = xyes; then :
90439053
90449054 $as_echo "#define HAVE_ET_COM_ERR_H /**/" >>confdefs.h
90459055
90469056 else
90479057 ac_fn_c_check_header_mongrel "$LINENO" "com_err.h" "ac_cv_header_com_err_h" "$ac_includes_default"
9048 if test "x$ac_cv_header_com_err_h" = x""yes; then :
9058 if test "x$ac_cv_header_com_err_h" = xyes; then :
90499059
90509060 else
90519061 as_fn_error $? "cannot locate com_err.h" "$LINENO" 5
90599069 set dummy compile_et; ac_word=$2
90609070 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
90619071 $as_echo_n "checking for $ac_word... " >&6; }
9062 if test "${ac_cv_path_COMPILE_ET+set}" = set; then :
9072 if ${ac_cv_path_COMPILE_ET+:} false; then :
90639073 $as_echo_n "(cached) " >&6
90649074 else
90659075 case $COMPILE_ET in
91059115 set dummy /usr/local/bin/compile_et; ac_word=$2
91069116 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
91079117 $as_echo_n "checking for $ac_word... " >&6; }
9108 if test "${ac_cv_path_COMPILE_ET+set}" = set; then :
9118 if ${ac_cv_path_COMPILE_ET+:} false; then :
91099119 $as_echo_n "(cached) " >&6
91109120 else
91119121 case $COMPILE_ET in
91489158 set dummy /usr/bin/compile_et; ac_word=$2
91499159 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
91509160 $as_echo_n "checking for $ac_word... " >&6; }
9151 if test "${ac_cv_path_COMPILE_ET+set}" = set; then :
9161 if ${ac_cv_path_COMPILE_ET+:} false; then :
91529162 $as_echo_n "(cached) " >&6
91539163 else
91549164 case $COMPILE_ET in
92419251
92429252 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for modern syslog" >&5
92439253 $as_echo_n "checking for modern syslog... " >&6; }
9244 if test "${cyrus_cv_lib_syslog+set}" = set; then :
9254 if ${cyrus_cv_lib_syslog+:} false; then :
92459255 $as_echo_n "(cached) " >&6
92469256 else
92479257 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
92889298 $as_echo "$SYSLOG_FACILITY" >&6; }
92899299
92909300 ac_fn_c_check_func "$LINENO" "getdtablesize" "ac_cv_func_getdtablesize"
9291 if test "x$ac_cv_func_getdtablesize" = x""yes; then :
9301 if test "x$ac_cv_func_getdtablesize" = xyes; then :
92929302 $as_echo "#define HAVE_GETDTABLESIZE 1" >>confdefs.h
92939303
92949304 else
93419351
93429352
93439353 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
9344 if test "x$ac_cv_func_dlopen" = x""yes; then :
9354 if test "x$ac_cv_func_dlopen" = xyes; then :
93459355
93469356 else
93479357 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
93489358 $as_echo_n "checking for dlopen in -ldl... " >&6; }
9349 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
9359 if ${ac_cv_lib_dl_dlopen+:} false; then :
93509360 $as_echo_n "(cached) " >&6
93519361 else
93529362 ac_check_lib_save_LIBS=$LIBS
93809390 fi
93819391 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
93829392 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
9383 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
9393 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
93849394 cat >>confdefs.h <<_ACEOF
93859395 #define HAVE_LIBDL 1
93869396 _ACEOF
93929402 fi
93939403
93949404 ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
9395 if test "x$ac_cv_func_crypt" = x""yes; then :
9405 if test "x$ac_cv_func_crypt" = xyes; then :
93969406 cmu_have_crypt=yes
93979407 else
93989408 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
93999409 $as_echo_n "checking for crypt in -lcrypt... " >&6; }
9400 if test "${ac_cv_lib_crypt_crypt+set}" = set; then :
9410 if ${ac_cv_lib_crypt_crypt+:} false; then :
94019411 $as_echo_n "(cached) " >&6
94029412 else
94039413 ac_check_lib_save_LIBS=$LIBS
94319441 fi
94329442 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5
94339443 $as_echo "$ac_cv_lib_crypt_crypt" >&6; }
9434 if test "x$ac_cv_lib_crypt_crypt" = x""yes; then :
9444 if test "x$ac_cv_lib_crypt_crypt" = xyes; then :
94359445 LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes
94369446 else
94379447 cmu_have_crypt=no
95089518 fi
95099519 fi
95109520 ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
9511 if test "x$ac_cv_header_gssapi_h" = x""yes; then :
9521 if test "x$ac_cv_header_gssapi_h" = xyes; then :
95129522
95139523 else
95149524 ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default"
9515 if test "x$ac_cv_header_gssapi_gssapi_h" = x""yes; then :
9525 if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then :
95169526
95179527 else
95189528 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling GSSAPI - no include files found" >&5
95459555
95469556 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5
95479557 $as_echo_n "checking for res_search in -lresolv... " >&6; }
9548 if test "${ac_cv_lib_resolv_res_search+set}" = set; then :
9558 if ${ac_cv_lib_resolv_res_search+:} false; then :
95499559 $as_echo_n "(cached) " >&6
95509560 else
95519561 ac_check_lib_save_LIBS=$LIBS
95799589 fi
95809590 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5
95819591 $as_echo "$ac_cv_lib_resolv_res_search" >&6; }
9582 if test "x$ac_cv_lib_resolv_res_search" = x""yes; then :
9592 if test "x$ac_cv_lib_resolv_res_search" = xyes; then :
95839593 cat >>confdefs.h <<_ACEOF
95849594 #define HAVE_LIBRESOLV 1
95859595 _ACEOF
96079617 gss_failed=0
96089618 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_unwrap in -lgssapi" >&5
96099619 $as_echo_n "checking for gss_unwrap in -lgssapi... " >&6; }
9610 if test "${ac_cv_lib_gssapi_gss_unwrap+set}" = set; then :
9620 if ${ac_cv_lib_gssapi_gss_unwrap+:} false; then :
96119621 $as_echo_n "(cached) " >&6
96129622 else
96139623 ac_check_lib_save_LIBS=$LIBS
96419651 fi
96429652 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gssapi_gss_unwrap" >&5
96439653 $as_echo "$ac_cv_lib_gssapi_gss_unwrap" >&6; }
9644 if test "x$ac_cv_lib_gssapi_gss_unwrap" = x""yes; then :
9654 if test "x$ac_cv_lib_gssapi_gss_unwrap" = xyes; then :
96459655 gss_impl="heimdal"
96469656 else
96479657 gss_failed=1
96569666 # check for libkrb5support first
96579667 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5int_getspecific in -lkrb5support" >&5
96589668 $as_echo_n "checking for krb5int_getspecific in -lkrb5support... " >&6; }
9659 if test "${ac_cv_lib_krb5support_krb5int_getspecific+set}" = set; then :
9669 if ${ac_cv_lib_krb5support_krb5int_getspecific+:} false; then :
96609670 $as_echo_n "(cached) " >&6
96619671 else
96629672 ac_check_lib_save_LIBS=$LIBS
96909700 fi
96919701 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5support_krb5int_getspecific" >&5
96929702 $as_echo "$ac_cv_lib_krb5support_krb5int_getspecific" >&6; }
9693 if test "x$ac_cv_lib_krb5support_krb5int_getspecific" = x""yes; then :
9703 if test "x$ac_cv_lib_krb5support_krb5int_getspecific" = xyes; then :
96949704 K5SUP=-lkrb5support K5SUPSTATIC=$gssapi_dir/libkrb5support.a
96959705 fi
96969706
96989708 gss_failed=0
96999709 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_unwrap in -lgssapi_krb5" >&5
97009710 $as_echo_n "checking for gss_unwrap in -lgssapi_krb5... " >&6; }
9701 if test "${ac_cv_lib_gssapi_krb5_gss_unwrap+set}" = set; then :
9711 if ${ac_cv_lib_gssapi_krb5_gss_unwrap+:} false; then :
97029712 $as_echo_n "(cached) " >&6
97039713 else
97049714 ac_check_lib_save_LIBS=$LIBS
97329742 fi
97339743 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gssapi_krb5_gss_unwrap" >&5
97349744 $as_echo "$ac_cv_lib_gssapi_krb5_gss_unwrap" >&6; }
9735 if test "x$ac_cv_lib_gssapi_krb5_gss_unwrap" = x""yes; then :
9745 if test "x$ac_cv_lib_gssapi_krb5_gss_unwrap" = xyes; then :
97369746 gss_impl="mit"
97379747 else
97389748 gss_failed=1
97659775 unset ac_cv_lib_gss_csf_gss_acq_user
97669776 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for csf_gss_acq_user in -lgss" >&5
97679777 $as_echo_n "checking for csf_gss_acq_user in -lgss... " >&6; }
9768 if test "${ac_cv_lib_gss_csf_gss_acq_user+set}" = set; then :
9778 if ${ac_cv_lib_gss_csf_gss_acq_user+:} false; then :
97699779 $as_echo_n "(cached) " >&6
97709780 else
97719781 ac_check_lib_save_LIBS=$LIBS
97999809 fi
98009810 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gss_csf_gss_acq_user" >&5
98019811 $as_echo "$ac_cv_lib_gss_csf_gss_acq_user" >&6; }
9802 if test "x$ac_cv_lib_gss_csf_gss_acq_user" = x""yes; then :
9812 if test "x$ac_cv_lib_gss_csf_gss_acq_user" = xyes; then :
98039813 gss_impl="cybersafe03"
98049814 else
98059815 unset ac_cv_lib_gss_csf_gss_acq_user;
98069816 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for csf_gss_acq_user in -lgss" >&5
98079817 $as_echo_n "checking for csf_gss_acq_user in -lgss... " >&6; }
9808 if test "${ac_cv_lib_gss_csf_gss_acq_user+set}" = set; then :
9818 if ${ac_cv_lib_gss_csf_gss_acq_user+:} false; then :
98099819 $as_echo_n "(cached) " >&6
98109820 else
98119821 ac_check_lib_save_LIBS=$LIBS
98399849 fi
98409850 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gss_csf_gss_acq_user" >&5
98419851 $as_echo "$ac_cv_lib_gss_csf_gss_acq_user" >&6; }
9842 if test "x$ac_cv_lib_gss_csf_gss_acq_user" = x""yes; then :
9852 if test "x$ac_cv_lib_gss_csf_gss_acq_user" = xyes; then :
98439853 gss_impl="cybersafe"
98449854 else
98459855 gss_failed=1
98639873 gss_failed=0
98649874 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_unwrap in -lgss" >&5
98659875 $as_echo_n "checking for gss_unwrap in -lgss... " >&6; }
9866 if test "${ac_cv_lib_gss_gss_unwrap+set}" = set; then :
9876 if ${ac_cv_lib_gss_gss_unwrap+:} false; then :
98679877 $as_echo_n "(cached) " >&6
98689878 else
98699879 ac_check_lib_save_LIBS=$LIBS
98979907 fi
98989908 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gss_gss_unwrap" >&5
98999909 $as_echo "$ac_cv_lib_gss_gss_unwrap" >&6; }
9900 if test "x$ac_cv_lib_gss_gss_unwrap" = x""yes; then :
9910 if test "x$ac_cv_lib_gss_gss_unwrap" = xyes; then :
99019911 gss_impl="seam"
99029912 else
99039913 gss_failed=1
1005810068 $as_echo "with implementation ${gss_impl}" >&6; }
1005910069 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5
1006010070 $as_echo_n "checking for res_search in -lresolv... " >&6; }
10061 if test "${ac_cv_lib_resolv_res_search+set}" = set; then :
10071 if ${ac_cv_lib_resolv_res_search+:} false; then :
1006210072 $as_echo_n "(cached) " >&6
1006310073 else
1006410074 ac_check_lib_save_LIBS=$LIBS
1009210102 fi
1009310103 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5
1009410104 $as_echo "$ac_cv_lib_resolv_res_search" >&6; }
10095 if test "x$ac_cv_lib_resolv_res_search" = x""yes; then :
10105 if test "x$ac_cv_lib_resolv_res_search" = xyes; then :
1009610106 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv"
1009710107 fi
1009810108
1010510115 for ac_func in gsskrb5_register_acceptor_identity
1010610116 do :
1010710117 ac_fn_c_check_func "$LINENO" "gsskrb5_register_acceptor_identity" "ac_cv_func_gsskrb5_register_acceptor_identity"
10108 if test "x$ac_cv_func_gsskrb5_register_acceptor_identity" = x""yes; then :
10118 if test "x$ac_cv_func_gsskrb5_register_acceptor_identity" = xyes; then :
1010910119 cat >>confdefs.h <<_ACEOF
1011010120 #define HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY 1
1011110121 _ACEOF
1017010180 fi
1017110181
1017210182 ac_fn_c_check_header_mongrel "$LINENO" "sasl/sasl.h" "ac_cv_header_sasl_sasl_h" "$ac_includes_default"
10173 if test "x$ac_cv_header_sasl_sasl_h" = x""yes; then :
10183 if test "x$ac_cv_header_sasl_sasl_h" = xyes; then :
1017410184 ac_fn_c_check_header_mongrel "$LINENO" "sasl/saslutil.h" "ac_cv_header_sasl_saslutil_h" "$ac_includes_default"
10175 if test "x$ac_cv_header_sasl_saslutil_h" = x""yes; then :
10185 if test "x$ac_cv_header_sasl_saslutil_h" = xyes; then :
1017610186 for i42 in lib64 lib; do
1017710187 if test -r ${with_staticsasl}/$i42/libsasl2.a; then
1017810188 ac_cv_found_sasl=yes
1022610236
1022710237 # be sure to check for a SASLv2 specific function
1022810238 ac_fn_c_check_header_mongrel "$LINENO" "sasl/sasl.h" "ac_cv_header_sasl_sasl_h" "$ac_includes_default"
10229 if test "x$ac_cv_header_sasl_sasl_h" = x""yes; then :
10239 if test "x$ac_cv_header_sasl_sasl_h" = xyes; then :
1023010240 ac_fn_c_check_header_mongrel "$LINENO" "sasl/saslutil.h" "ac_cv_header_sasl_saslutil_h" "$ac_includes_default"
10231 if test "x$ac_cv_header_sasl_saslutil_h" = x""yes; then :
10241 if test "x$ac_cv_header_sasl_saslutil_h" = xyes; then :
1023210242 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prop_get in -lsasl2" >&5
1023310243 $as_echo_n "checking for prop_get in -lsasl2... " >&6; }
10234 if test "${ac_cv_lib_sasl2_prop_get+set}" = set; then :
10244 if ${ac_cv_lib_sasl2_prop_get+:} false; then :
1023510245 $as_echo_n "(cached) " >&6
1023610246 else
1023710247 ac_check_lib_save_LIBS=$LIBS
1026510275 fi
1026610276 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_prop_get" >&5
1026710277 $as_echo "$ac_cv_lib_sasl2_prop_get" >&6; }
10268 if test "x$ac_cv_lib_sasl2_prop_get" = x""yes; then :
10278 if test "x$ac_cv_lib_sasl2_prop_get" = xyes; then :
1026910279 ac_cv_found_sasl=yes
1027010280 else
1027110281 ac_cv_found_sasl=no
1036510375
1036610376 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sasl_checkapop in -lsasl2" >&5
1036710377 $as_echo_n "checking for sasl_checkapop in -lsasl2... " >&6; }
10368 if test "${ac_cv_lib_sasl2_sasl_checkapop+set}" = set; then :
10378 if ${ac_cv_lib_sasl2_sasl_checkapop+:} false; then :
1036910379 $as_echo_n "(cached) " >&6
1037010380 else
1037110381 ac_check_lib_save_LIBS=$LIBS
1039910409 fi
1040010410 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_sasl_checkapop" >&5
1040110411 $as_echo "$ac_cv_lib_sasl2_sasl_checkapop" >&6; }
10402 if test "x$ac_cv_lib_sasl2_sasl_checkapop" = x""yes; then :
10412 if test "x$ac_cv_lib_sasl2_sasl_checkapop" = xyes; then :
1040310413
1040410414 $as_echo "#define HAVE_APOP /**/" >>confdefs.h
1040510415
1043510445 set dummy $ac_prog; ac_word=$2
1043610446 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1043710447 $as_echo_n "checking for $ac_word... " >&6; }
10438 if test "${ac_cv_prog_PERL+set}" = set; then :
10448 if ${ac_cv_prog_PERL+:} false; then :
1043910449 $as_echo_n "(cached) " >&6
1044010450 else
1044110451 if test -n "$PERL"; then
1048210492 PERL_SUBDIRS="imap"
1048310493 PERL="${with_perl}"
1048410494 case "${target_os}" in
10485 linux*|netbsd*)
10495 linux*|netbsd*|freebsd*|dragonfly*)
1048610496 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl cccdlflags needed on \"${target_os}\"" >&5
1048710497 $as_echo_n "checking for perl cccdlflags needed on \"${target_os}\"... " >&6; }
1048810498 eval `${PERL} -V:cccdlflags`
1053010540 cmu_save_LIBS="$LIBS"
1053110541 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for request_init in -lwrap" >&5
1053210542 $as_echo_n "checking for request_init in -lwrap... " >&6; }
10533 if test "${ac_cv_lib_wrap_request_init+set}" = set; then :
10543 if ${ac_cv_lib_wrap_request_init+:} false; then :
1053410544 $as_echo_n "(cached) " >&6
1053510545 else
1053610546 ac_check_lib_save_LIBS=$LIBS
1056410574 fi
1056510575 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wrap_request_init" >&5
1056610576 $as_echo "$ac_cv_lib_wrap_request_init" >&6; }
10567 if test "x$ac_cv_lib_wrap_request_init" = x""yes; then :
10577 if test "x$ac_cv_lib_wrap_request_init" = xyes; then :
1056810578
1056910579 ac_fn_c_check_header_mongrel "$LINENO" "tcpd.h" "ac_cv_header_tcpd_h" "$ac_includes_default"
10570 if test "x$ac_cv_header_tcpd_h" = x""yes; then :
10580 if test "x$ac_cv_header_tcpd_h" = xyes; then :
1057110581
1057210582 else
1057310583 with_libwrap=no
1059210602 LIB_WRAP="-lwrap"
1059310603 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yp_get_default_domain in -lnsl" >&5
1059410604 $as_echo_n "checking for yp_get_default_domain in -lnsl... " >&6; }
10595 if test "${ac_cv_lib_nsl_yp_get_default_domain+set}" = set; then :
10605 if ${ac_cv_lib_nsl_yp_get_default_domain+:} false; then :
1059610606 $as_echo_n "(cached) " >&6
1059710607 else
1059810608 ac_check_lib_save_LIBS=$LIBS
1062610636 fi
1062710637 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_yp_get_default_domain" >&5
1062810638 $as_echo "$ac_cv_lib_nsl_yp_get_default_domain" >&6; }
10629 if test "x$ac_cv_lib_nsl_yp_get_default_domain" = x""yes; then :
10639 if test "x$ac_cv_lib_nsl_yp_get_default_domain" = xyes; then :
1063010640 LIB_WRAP="${LIB_WRAP} -lnsl"
1063110641 fi
1063210642
1065910669 set dummy net-snmp-config; ac_word=$2
1066010670 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1066110671 $as_echo_n "checking for $ac_word... " >&6; }
10662 if test "${ac_cv_path_SNMP_CONFIG+set}" = set; then :
10672 if ${ac_cv_path_SNMP_CONFIG+:} false; then :
1066310673 $as_echo_n "(cached) " >&6
1066410674 else
1066510675 case $SNMP_CONFIG in
1071910729 for ac_header in net-snmp/agent/agent_module_config.h
1072010730 do :
1072110731 ac_fn_c_check_header_mongrel "$LINENO" "net-snmp/agent/agent_module_config.h" "ac_cv_header_net_snmp_agent_agent_module_config_h" "$ac_includes_default"
10722 if test "x$ac_cv_header_net_snmp_agent_agent_module_config_h" = x""yes; then :
10732 if test "x$ac_cv_header_net_snmp_agent_agent_module_config_h" = xyes; then :
1072310733 cat >>confdefs.h <<_ACEOF
1072410734 #define HAVE_NET_SNMP_AGENT_AGENT_MODULE_CONFIG_H 1
1072510735 _ACEOF
1074310753 cmu_save_LIBS="$LIBS"
1074410754 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sprint_objid in -lsnmp" >&5
1074510755 $as_echo_n "checking for sprint_objid in -lsnmp... " >&6; }
10746 if test "${ac_cv_lib_snmp_sprint_objid+set}" = set; then :
10756 if ${ac_cv_lib_snmp_sprint_objid+:} false; then :
1074710757 $as_echo_n "(cached) " >&6
1074810758 else
1074910759 ac_check_lib_save_LIBS=$LIBS
1077710787 fi
1077810788 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_snmp_sprint_objid" >&5
1077910789 $as_echo "$ac_cv_lib_snmp_sprint_objid" >&6; }
10780 if test "x$ac_cv_lib_snmp_sprint_objid" = x""yes; then :
10790 if test "x$ac_cv_lib_snmp_sprint_objid" = xyes; then :
1078110791
1078210792 ac_fn_c_check_header_mongrel "$LINENO" "ucd-snmp/version.h" "ac_cv_header_ucd_snmp_version_h" "$ac_includes_default"
10783 if test "x$ac_cv_header_ucd_snmp_version_h" = x""yes; then :
10793 if test "x$ac_cv_header_ucd_snmp_version_h" = xyes; then :
1078410794
1078510795 else
1078610796 with_snmp=no
1080510815 LIB_UCDSNMP="-lucdagent -lucdmibs -lsnmp"
1080610816 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpmdbOpen in -lrpm" >&5
1080710817 $as_echo_n "checking for rpmdbOpen in -lrpm... " >&6; }
10808 if test "${ac_cv_lib_rpm_rpmdbOpen+set}" = set; then :
10818 if ${ac_cv_lib_rpm_rpmdbOpen+:} false; then :
1080910819 $as_echo_n "(cached) " >&6
1081010820 else
1081110821 ac_check_lib_save_LIBS=$LIBS
1083910849 fi
1084010850 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpm_rpmdbOpen" >&5
1084110851 $as_echo "$ac_cv_lib_rpm_rpmdbOpen" >&6; }
10842 if test "x$ac_cv_lib_rpm_rpmdbOpen" = x""yes; then :
10852 if test "x$ac_cv_lib_rpm_rpmdbOpen" = xyes; then :
1084310853 LIB_UCDSNMP="${LIB_UCDSNMP} -lrpm -lpopt"
1084410854 fi
1084510855
1096110971 :end' >>confcache
1096210972 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
1096310973 if test -w "$cache_file"; then
10964 test "x$cache_file" != "x/dev/null" &&
10974 if test "x$cache_file" != "x/dev/null"; then
1096510975 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
1096610976 $as_echo "$as_me: updating cache $cache_file" >&6;}
10967 cat confcache >$cache_file
10977 if test ! -f "$cache_file" || test -h "$cache_file"; then
10978 cat confcache >"$cache_file"
10979 else
10980 case $cache_file in #(
10981 */* | ?:*)
10982 mv -f confcache "$cache_file"$$ &&
10983 mv -f "$cache_file"$$ "$cache_file" ;; #(
10984 *)
10985 mv -f confcache "$cache_file" ;;
10986 esac
10987 fi
10988 fi
1096810989 else
1096910990 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
1097010991 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
1099711018
1099811019
1099911020
11000 : ${CONFIG_STATUS=./config.status}
11021 : "${CONFIG_STATUS=./config.status}"
1100111022 ac_write_fail=0
1100211023 ac_clean_files_save=$ac_clean_files
1100311024 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
1109811119 IFS=" "" $as_nl"
1109911120
1110011121 # Find who we are. Look in the path if we contain no directory separator.
11122 as_myself=
1110111123 case $0 in #((
1110211124 *[\\/]* ) as_myself=$0 ;;
1110311125 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1140511427 # values after options handling.
1140611428 ac_log="
1140711429 This file was extended by $as_me, which was
11408 generated by GNU Autoconf 2.67. Invocation command line was
11430 generated by GNU Autoconf 2.68. Invocation command line was
1140911431
1141011432 CONFIG_FILES = $CONFIG_FILES
1141111433 CONFIG_HEADERS = $CONFIG_HEADERS
1146711489 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1146811490 ac_cs_version="\\
1146911491 config.status
11470 configured by $0, generated by GNU Autoconf 2.67,
11492 configured by $0, generated by GNU Autoconf 2.68,
1147111493 with options \\"\$ac_cs_config\\"
1147211494
1147311495 Copyright (C) 2010 Free Software Foundation, Inc.
1160011622 "$EXTRA_OUTPUT") CONFIG_FILES="$CONFIG_FILES $EXTRA_OUTPUT" ;;
1160111623 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
1160211624
11603 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
11625 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
1160411626 esac
1160511627 done
1160611628
1162211644 # after its creation but before its name has been assigned to `$tmp'.
1162311645 $debug ||
1162411646 {
11625 tmp=
11647 tmp= ac_tmp=
1162611648 trap 'exit_status=$?
11627 { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
11649 : "${ac_tmp:=$tmp}"
11650 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
1162811651 ' 0
1162911652 trap 'as_fn_exit 1' 1 2 13 15
1163011653 }
1163211655
1163311656 {
1163411657 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
11635 test -n "$tmp" && test -d "$tmp"
11658 test -d "$tmp"
1163611659 } ||
1163711660 {
1163811661 tmp=./conf$$-$RANDOM
1163911662 (umask 077 && mkdir "$tmp")
1164011663 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
11664 ac_tmp=$tmp
1164111665
1164211666 # Set up the scripts for CONFIG_FILES section.
1164311667 # No need to generate them if there are no CONFIG_FILES.
1165911683 ac_cs_awk_cr=$ac_cr
1166011684 fi
1166111685
11662 echo 'BEGIN {' >"$tmp/subs1.awk" &&
11686 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
1166311687 _ACEOF
1166411688
1166511689
1168711711 rm -f conf$$subs.sh
1168811712
1168911713 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
11690 cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
11714 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
1169111715 _ACEOF
1169211716 sed -n '
1169311717 h
1173511759 rm -f conf$$subs.awk
1173611760 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1173711761 _ACAWK
11738 cat >>"\$tmp/subs1.awk" <<_ACAWK &&
11762 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
1173911763 for (key in S) S_is_set[key] = 1
1174011764 FS = ""
1174111765
1176711791 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
1176811792 else
1176911793 cat
11770 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
11794 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
1177111795 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
1177211796 _ACEOF
1177311797
1180111825 # No need to generate them if there are no CONFIG_HEADERS.
1180211826 # This happens for instance with `./config.status Makefile'.
1180311827 if test -n "$CONFIG_HEADERS"; then
11804 cat >"$tmp/defines.awk" <<\_ACAWK ||
11828 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
1180511829 BEGIN {
1180611830 _ACEOF
1180711831
1181311837 # handling of long lines.
1181411838 ac_delim='%!_!# '
1181511839 for ac_last_try in false false :; do
11816 ac_t=`sed -n "/$ac_delim/p" confdefs.h`
11817 if test -z "$ac_t"; then
11840 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
11841 if test -z "$ac_tt"; then
1181811842 break
1181911843 elif $ac_last_try; then
1182011844 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
1191511939 esac
1191611940 case $ac_mode$ac_tag in
1191711941 :[FHL]*:*);;
11918 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
11942 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
1191911943 :[FH]-) ac_tag=-:-;;
1192011944 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
1192111945 esac
1193411958 for ac_f
1193511959 do
1193611960 case $ac_f in
11937 -) ac_f="$tmp/stdin";;
11961 -) ac_f="$ac_tmp/stdin";;
1193811962 *) # Look for the file first in the build tree, then in the source tree
1193911963 # (if the path is not absolute). The absolute path cannot be DOS-style,
1194011964 # because $ac_f cannot contain `:'.
1194311967 [\\/$]*) false;;
1194411968 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
1194511969 esac ||
11946 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
11970 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
1194711971 esac
1194811972 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
1194911973 as_fn_append ac_file_inputs " '$ac_f'"
1196911993 esac
1197011994
1197111995 case $ac_tag in
11972 *:-:* | *:-) cat >"$tmp/stdin" \
11973 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
11996 *:-:* | *:-) cat >"$ac_tmp/stdin" \
11997 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
1197411998 esac
1197511999 ;;
1197612000 esac
1210012124 s&@INSTALL@&$ac_INSTALL&;t t
1210112125 $ac_datarootdir_hack
1210212126 "
12103 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
12104 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
12127 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
12128 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
1210512129
1210612130 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
12107 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
12108 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
12131 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
12132 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
12133 "$ac_tmp/out"`; test -z "$ac_out"; } &&
1210912134 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
1211012135 which seems to be undefined. Please make sure it is defined" >&5
1211112136 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
1211212137 which seems to be undefined. Please make sure it is defined" >&2;}
1211312138
12114 rm -f "$tmp/stdin"
12139 rm -f "$ac_tmp/stdin"
1211512140 case $ac_file in
12116 -) cat "$tmp/out" && rm -f "$tmp/out";;
12117 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
12141 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
12142 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
1211812143 esac \
1211912144 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
1212012145 ;;
1212512150 if test x"$ac_file" != x-; then
1212612151 {
1212712152 $as_echo "/* $configure_input */" \
12128 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
12129 } >"$tmp/config.h" \
12153 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
12154 } >"$ac_tmp/config.h" \
1213012155 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
12131 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
12156 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
1213212157 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
1213312158 $as_echo "$as_me: $ac_file is unchanged" >&6;}
1213412159 else
1213512160 rm -f "$ac_file"
12136 mv "$tmp/config.h" "$ac_file" \
12161 mv "$ac_tmp/config.h" "$ac_file" \
1213712162 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
1213812163 fi
1213912164 else
1214012165 $as_echo "/* $configure_input */" \
12141 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
12166 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
1214212167 || as_fn_error $? "could not create -" "$LINENO" 5
1214312168 fi
1214412169 ;;
11701170 dnl libraries will be compiled as PIC if perl requires PIC objects
11711171 dnl -- this is needed on NetBSD and Linux, but seems to cause problems on atleast Solaris --
11721172 case "${target_os}" in
1173 linux*|netbsd*)
1173 linux*|netbsd*|freebsd*|dragonfly*)
11741174 AC_MSG_CHECKING(for perl cccdlflags needed on "${target_os}")
11751175 eval `${PERL} -V:cccdlflags`
11761176 PERL_CCCDLFLAGS="$cccdlflags"
66 <title>Changes to the Cyrus IMAP Server</title>
77 </head>
88 <body>
9
10 <h1>Changes to the Cyrus IMAP Server since 2.4.10</h1>
11 <ul>
12 <li>fixed replication recovery from different messages
13 at the each end</li>
14 <li>Bug #3489 - fixed quotalegacy handling of prefixes so
15 only exact subfolders match</li>
16 <li>Bug #3498 - fixed deletion of users quota files
17 with unixheriarchysep enabled, thanks Leena Heino</li>
18 <li>Bug #3491 - NOOP and UNAUTHENTICATE for timsieved,
19 thanks Dilyan Palauzov</li>
20 <li>Bug #3492 - better response codes for timsieved,
21 thanks Dilyan Palauzov</li>
22 <li>Bug #3497 - fix cmd syslog from master,
23 thanks Kristof Katus</li>
24 <li>Bug #3503 - compilation of perl libraries on
25 dragonfly and freebsd, thanks OBATA Akio</li>
26 <li>Bug #3451 - allow CC to have spaces</li>
27 <li>Bug #3505 - fix sync_reset,
28 thanks David Carter</li>
29 <li>Bug #3506 - use literal+ for sync_(client|server),
30 thanks David Carter</li>
31 <li>Bug #3300 - use portable function for TCP constants,
32 thanks OBATA Akio</li>
33 <li>Bug #3507 - fix replication recovery with non-delayed
34 expunge, thanks Julien Coloos</li>
35 <li>Bug #3495 - improved duplicate suppression,
36 thanks Kristof Katus</li>
37 <li>Bug #2772/3463 - fixed crashes in THREAD by correcting
38 folding of references headers</li>
39 <li>Bug #3439 - fix ugly syslog message for vacation</li>
40 <li>Bug #3499 - options to disable namespaces to reduce
41 load on big servers with no shared folders. Thanks
42 Olivier ROLAND</li>
43 <li>Changed skiplist to truncate old files after checkpoint,
44 which can save disk space on tmpfs or small ssds when
45 old copies were held open by other processes</li>
46 <li>Made Cyrus more robust against corruption in
47 mailboxes.db data, so it will return an error rather
48 than crashing on invalid entries</li>
49 <li>Fix for CVE-2011-3208, a remotely exploitable buffer
50 overflow in nntpd - thanks Coverity</li>
51 </ul>
52
53 <h1>Changes to the Cyrus IMAP Server since 2.4.9</h1>
54 <ul>
55 <li>fixed handling of unparsable emails during append (which
56 would cause invalid cyrus.index records otherwise)</li>
57 <li>quota: fix a pile of bugs. #1801, virtdomain support;
58 #2728, slow user delete; #3178, "file name too long" with
59 big mailbox names; #3179, quota -f doubles usage.</li>
60 <li>Bug #3043 - parse multiple groups in headers correctly</li>
61 <li>Bug #3158 - lmtp backend connection timeout</li>
62 <li>Bug #3223 - limit MIME parsing depth to avoid stack overflows</li>
63 <li>Bug #3273 - add SORT=DISPLAY support (but note: still questions
64 about correctness of unicode sorting)</li>
65 <li>Bug #3504 - convert all sieve scripts to \r\n line endings
66 on upload</li>
67 <li>Bug #3402 - options to munge 8bit characters in headers
68 during lmtp delivery to avoid backscatter</li>
69 <li>sync_client: fix broken keepalive TCP options (I doubt anyone
70 ever tried to use it)</li>
71 <li>Bug #3482 - add "-o" option to ipurge to only purge messages
72 with \Deleted flag set</li>
73 </ul>
974
1075 <h1>Changes to the Cyrus IMAP Server since 2.4.8</h1>
1176 <ul>
66 <body>
77
88 <h1>Upgrading From Previous Versions</h1>
9
10 <h1>Upgrading from 2.4.10</h2>
11 <ul>
12 <li>Duplicate database formats have changed, so any duplicate or
13 vacation data will be lost - meaning that vacation responses
14 will be sent again, and duplicates just across the upgrade
15 time will both get delivered.</li>
16 </ul>
17
18
19 <h2>Upgrading from 2.4.9</h2>
20 <ul>
21 <li>quota -f now works correctly. If you are upgrading from earlier
22 than 2.4.9 we recommend that you run quota -f to ensure that all
23 quotas are now correct. There is a slight race condition in the
24 quota command, so it's safest to run with the server shut down,
25 but this has always existed.</li>
26 <li>On the topic of quota -f, the documentation has been updated to
27 make it quite clear that you need to give "complete" prefixes if
28 using quotalegacy, as it doesn't implement quite the same semantics
29 as other databases. If you run 'quota -f a' and you have domains
30 starting with 'a', you will be quite sad at the results. So don't
31 do that. Running quota -f with no argument, or with a full domain
32 or full user specification is perfectly safe.</li>
33 </ul>
934
1035 <h2>Upgrading from 2.4.8</h2>
1136 <ul>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:34 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:38 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:34 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:38 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:34 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:38 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:38 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:38 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:38 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:35 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:36 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:39 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:36 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
353353 <p style="margin-left:18%;">Maximum number of transactions
354354 to be supported in the berkeley environment.</p>
355355
356 <p style="margin-left:11%;"><b>boundary_limit:</b> 1000</p>
357
358 <p style="margin-left:18%;">messages are parsed recursively
359 and a deep enough MIME structure can cause a stack overflow.
360 Do not parse deeper than this many layers of MIME structure.
361 The default of 1000 is much higher than any sane message
362 should have.</p>
363
356364 <p style="margin-left:11%;"><b>client_timeout:</b> 10</p>
357365
358366 <p style="margin-left:18%;">Number of seconds to wait
437445 ability to delete a mailbox. If a user has this right, they
438446 will automatically be given the new &rsquo;x&rsquo;
439447 right.</p>
448
449 <p style="margin-left:11%;"><b>disable_user_namespace:</b>
450 0</p>
451
452 <p style="margin-left:18%;">Preclude list command on user
453 namespace. If set to &rsquo;yes&rsquo;, the LIST response
454 will never include any other user&rsquo;s mailbox. Admin
455 users will always see all mailboxes. The default is
456 &rsquo;no&rsquo;</p>
457
458
459 <p style="margin-left:11%;"><b>disable_shared_namespace:</b>
460 0</p>
461
462 <p style="margin-left:18%;">Preclude list command on user
463 namespace. If set to &rsquo;yes&rsquo;, the LIST response
464 will never include any non-user mailboxes. Admin users will
465 always see all mailboxes. The default is
466 &rsquo;no&rsquo;</p>
440467
441468
442469 <p style="margin-left:11%;"><b>disconnect_on_vanished_mailbox:</b>
940967 failure won&rsquo;t occur until the mailbox is already over
941968 quota.</p>
942969
970 <p style="margin-left:11%;"><b>lmtp_strict_rfc2821:</b>
971 1</p>
972
973 <p style="margin-left:18%;">By default, lmtpd will be
974 strict (per RFC 2821) with regards to which envelope
975 addresses are allowed. If this option is set to false, 8bit
976 characters in the local-part of envelope addresses are
977 changed to &rsquo;X&rsquo; instead. This is useful to avoid
978 generating backscatter with certain MTAs like Postfix or
979 Exim which accept such messages.</p>
980
943981 <p style="margin-left:11%;"><b>lmtpsocket:</b>
944982 {configdirectory}/socket/lmtp</p>
945983
946984 <p style="margin-left:18%;">Unix domain socket that lmtpd
947985 listens on, used by deliver(8). This should match the path
948986 specified in cyrus.conf(5).</p>
987
988 <p style="margin-left:11%;"><b>lmtptxn_timeout:</b> 300</p>
989
990 <p style="margin-left:18%;">Timeout (in seconds) used
991 during a lmtp transaction to a remote backend (e.g. in a
992 murder environment). Can be used to prevent hung lmtpds on
993 proxy hosts when a backend server becomes unresponsive
994 during a lmtp transaction. The default is 300 - change to
995 zero for infinite.</p>
949996
950997 <p style="margin-left:11%;"><b>loginrealms:</b> &lt;empty
951998 string&gt;</p>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:36 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:36 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:36 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:36 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
4747 <p style="margin-left:11%; margin-top: 1em"><b>ipurge</b> [
4848 <b>&minus;f</b> ] [ <b>&minus;C</b> <i>config-file</i> ] [
4949 <b>&minus;x</b> ] [ <b>&minus;X</b> ] [ <b>&minus;i</b> ] [
50 <b>&minus;s</b> ] <br>
50 <b>&minus;s</b> ] [ <b>&minus;o</b> ] <br>
5151 [ <b>&minus;d</b> <i>days</i> | <b>&minus;b</b> <i>bytes</i>
5252 | <b>&minus;k</b> <i>Kbytes</i> | <b>&minus;m</b>
5353 <i>Mbytes</i> ] <br>
182182
183183
184184 <p>Skip over messages that have the \Flagged flag set.</p></td></tr>
185 <tr valign="top" align="left">
186 <td width="11%"></td>
187 <td width="3%">
188
189
190 <p><b>&minus;o</b></p></td>
191 <td width="8%"></td>
192 <td width="78%">
193
194
195 <p>Only purge messages that have the \Deleted flag set.</p></td></tr>
185196 </table>
186197
187198 <h2>FILES
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:36 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:36 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:40 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:37 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:41 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:42 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:42 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:42 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:42 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:42 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:42 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:38 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:42 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
00 <!-- Creator : groff version 1.21 -->
1 <!-- CreationDate: Tue Jun 21 21:51:39 2011 -->
1 <!-- CreationDate: Thu Sep 8 21:03:42 2011 -->
22 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
33 "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
Binary diff not shown
Binary diff not shown
7575 <TD>Extended URLFETCH for Binary and Converted Parts</TD></TR>
7676 <TR><TD><A HREF="http://www.ietf.org/internet-drafts/draft-daboo-imap-annotatemore-11.txt">
7777 draft-daboo-imap-annotatemore</A></TD>
78 <TD>IMAP ANNOTATEMORE Extension</TD></TR>
78 <TD>ANNOTATEMORE Draft</TD></TR>
79 <TR><TD><A HREF="http://www.ietf.org/rfc/rfc5464.txt">RFC 5464</A></TD>
80 <TD>The IMAP METADATA Extension</TD></TR>
81 <TR><TD><A HREF="http://tools.ietf.org/html/draft-ietf-morg-list-specialuse-06">
82 draft-ietf-morg-list-specialuse</A></TD>
83 <TD>IMAP SPECIALUSE Draft (And non-standard Google XLIST support)</TD></TR>
84 <TR><TD><A HREF="http://www.ietf.org/rfc/rfc5819.txt">RFC 5819</A></TD>
85 <TD>IMAP4 Extension for Returning STATUS Information in Extended LIST</TD></TR>
86 <TR><TD><A HREF="http://www.ietf.org/rfc/rfc5957.txt">RFC 5957</A></TD>
87 <TD>Display-Based Address Sorting for the IMAP4 SORT Extension</TD></TR>
7988
8089
8190 <TR><TD COLSPAN=2><br><h2>POP</h2></TD></TR>
0 Changes to the Cyrus IMAP Server since 2.4.10
1
2 * fixed replication recovery from different messages at the each end
3 * Bug #3489 - fixed quotalegacy handling of prefixes so only exact
4 subfolders match
5 * Bug #3498 - fixed deletion of users quota files with
6 unixheriarchysep enabled, thanks Leena Heino
7 * Bug #3491 - NOOP and UNAUTHENTICATE for timsieved, thanks Dilyan
8 Palauzov
9 * Bug #3492 - better response codes for timsieved, thanks Dilyan
10 Palauzov
11 * Bug #3497 - fix cmd syslog from master, thanks Kristof Katus
12 * Bug #3503 - compilation of perl libraries on dragonfly and freebsd,
13 thanks OBATA Akio
14 * Bug #3451 - allow CC to have spaces
15 * Bug #3505 - fix sync_reset, thanks David Carter
16 * Bug #3506 - use literal+ for sync_(client|server), thanks David
17 Carter
18 * Bug #3300 - use portable function for TCP constants, thanks OBATA
19 Akio
20 * Bug #3507 - fix replication recovery with non-delayed expunge,
21 thanks Julien Coloos
22 * Bug #3495 - improved duplicate suppression, thanks Kristof Katus
23 * Bug #2772/3463 - fixed crashes in THREAD by correcting folding of
24 references headers
25 * Bug #3439 - fix ugly syslog message for vacation
26 * Bug #3499 - options to disable namespaces to reduce load on big
27 servers with no shared folders. Thanks Olivier ROLAND
28 * Changed skiplist to truncate old files after checkpoint, which can
29 save disk space on tmpfs or small ssds when old copies were held
30 open by other processes
31 * Made Cyrus more robust against corruption in mailboxes.db data, so
32 it will return an error rather than crashing on invalid entries
33 * Fix for CVE-2011-3208, a remotely exploitable buffer overflow in
34 nntpd - thanks Coverity
35
36 Changes to the Cyrus IMAP Server since 2.4.9
37
38 * fixed handling of unparsable emails during append (which would
39 cause invalid cyrus.index records otherwise)
40 * quota: fix a pile of bugs. #1801, virtdomain support; #2728, slow
41 user delete; #3178, "file name too long" with big mailbox names;
42 #3179, quota -f doubles usage.
43 * Bug #3043 - parse multiple groups in headers correctly
44 * Bug #3158 - lmtp backend connection timeout
45 * Bug #3223 - limit MIME parsing depth to avoid stack overflows
46 * Bug #3273 - add SORT=DISPLAY support (but note: still questions
47 about correctness of unicode sorting)
48 * Bug #3504 - convert all sieve scripts to \r\n line endings on
49 upload
50 * Bug #3402 - options to munge 8bit characters in headers during lmtp
51 delivery to avoid backscatter
52 * sync_client: fix broken keepalive TCP options (I doubt anyone ever
53 tried to use it)
54 * Bug #3482 - add "-o" option to ipurge to only purge messages with
55 \Deleted flag set
56
057 Changes to the Cyrus IMAP Server since 2.4.8
158
259 * fixed crashes in seen handling
00 Upgrading From Previous Versions
11
2 Upgrading from 2.4.8
3
4 * CYRUS_PREFIX environemnt varabile. If you have an environment
5 variable "CYRUS_PREFIX" then config files will be searched for in
6 there first, so for example the file /var/cyrus/etc/imapd.conf will
7 override /etc/imapd.conf if your CYRUS_PREFIX is /var/cyrus. This
8 is to make things easier for sites with multiple installs on a
9 single machine. You will want to check that there aren't unexpected
10 files in those locations when upgrading.
11 * New config options: *_db_path allow moving individual DB files to
12 different partitions - for example you may want to put the
13 deliver.db onto tmpfs to improve performance.
14 * KNOWN BUG: quota -f can double ALL quota usage values for all
15 users. This is particularly bad because of the bug fixed in this
16 release where quotaroots were not correctly updated on folder
17 rename. Recommended workaround: run quota -f twice.
18
19 Upgrading from 2.4.7
20
21 * New config option: proc_path allows setting the path to the proc
22 directory onto tmpfs more easily
23
24 Upgrading from 2.4.6
25
26 * New config option: failedloginpause allows you to change the pause
27 after a failed login from the existing default of 3 seconds
28 * On Solaris: now getpassphrase is used, so passwords longer than 8
29 characters will work with management tools
30 * $confdir/proc now gets created automatically if it doesn't exist,
31 which may impact init script design
32 * If you have damaged mailboxes that weren't previously fixable, a
33 reconstruct of those mailboxes may be advised
34
35 Upgrading from 2.4.5
36
37 * New config option: suppress_capabilities, which takes a space
38 separated list of capabilities which will NOT be given in any imap
39 capability response. This can be used on frontends to not display
40 capabilities that older backends don't have, so clients don't get
41 confused
42
43 Upgrading from 2.4.4
44
45 * sync_client no longer forks two process - it just pre-forks a
46 single process in rolling replication mode and uses it "forever".
47 This is to avoid the bug where it used to open the BDB environment
48 once before forking, then close it in every child, causing the
49 reference count to go negative. This also means you can start it
50 without '-o' and still have the master start without the replica
51 already running.
52
53 Upgrading from 2.4.3
54
55 * Actually, it's more upgrading directly to here from 2.3.x or older.
56 ALL upgrades from previous versions now incur a full re-parse of
57 all messages, which may take a while. In exchange you get reliable
58 upgrades though, and guaranteed still-searchable cyrus.cache
59 records.
60
61 Upgrading from 2.4.2
62
63 * The AFS ptloader configure options have changed. If you were
64 previously specifying --with-afs when you built, you'll now want to
65 use --enable-afs instead. Additionally, you may now specify
66 --with-afs-libdir and --with-afs-incdir to facilitate finding the
67 AFS libraries and header files.
68 * The sync_log_names option has been replaced with sync_log_channels
69 and the documentation and tools updated to match. This is to use a
70 less overloaded term and allow multi-channel replication to be
71 used.
72 * Cyrus 2.4.3 can now XFER mailboxes back to earlier version (at
73 least as far back as Cyrus 2.2.12) in a murder configuration.
74 * sync_client in rolling mode now only connects after forking, so it
75 no longer blocks startup. You can remove the '-o' option from your
76 cyrus.conf entry if you want, and not have to start sync_client
77 manually afterwards!
78
79 Upgrading from 2.4.0
80
81 * The response to the "ID" command has changed slightly to include
82 git metadata rather than CVS metadata - so your in-house tools
83 expecting a particular value may need changing (very unlikely)
84
85 Upgrading from 2.3.16
86
87 * There is a new index format, so downgrades are not possible without
88 a reconstruct. We recommend that you take a full backup before
89 upgrading, and perform an upgrade with a small test server if
90 possible to make sure everything will work for your site.
91 * MURDER does work, but you can't rename a mailbox back to a previous
92 version backend because the index was upgraded.
93 * There is a new replication protocol, so you can't replicate between
94 2.4.0 and previous versions in either direction. You need to
95 upgrade both before you can restart repliation.
96 * The default value for delayed_expunge has changed to provide better
97 QRESYNC and replication support. The default is still pretty
98 efficient, but you may want to change it to 'immediate', the
99 previous default
100 * The default type for all databases is now skiplist which is very
101 reliable now, all the bugs are ironed out! Because ctl_cyrusdb -r
102 automatically converts databases between known types, you shouldn't
103 need to do anything, but if you want to keep the old defaults,
104 you'll need to make them explicit in your imapd.conf as follows:
105
106 duplicate_db: berkeley-nosync
107 ptscache_db: berkeley
108 statuscache_db: berkeley-nosync
109 tlscache_db: berkeley-nosync
110
111 * There is a new lock folder which defaults to configdir/lock/ and
112 contains one zerobyte file per mailbox. These can get pretty hot,
113 and don't need to persist over reboots (they will be auto-created
114 when needed) - so you may want to define mboxname_lockpath to be on
115 tmpfs or ramfs or similar. It certainly makes sense to clean it out
116 on restart, because names will persist in there forever otherwise.
117 Even on mailbox delete these files aren't removed (to avoid
118 potential race conditions)
119 * The make_md5 and make_sha1 utilities no longer exist. If you want
120 to check message file integrity, the best way is reconstruct -r -n
121 -G. This will parse every message file, check the sha1 against the
122 value stored in the cyrus.index, and tell you about mismatches
123 without fixing them.
124 * Speaking of reconstruct, the switches have changed, as has the
125 implementation. It fixes the mailbox "in place" a lot more rather
126 than creating a new mailbox, meaning that IMAP semantics won't be
127 broken. It's more likely to abort rather than complete if your
128 filesystem permissions are wrong - fix them first!
129
130 -kRemoved, expunge data is always kept
131
132 -gRemoved, GUIDs are always stored
133
134 -GChanged, now means "re-parse the message". If not specified,
135 reconstruct only checks the message size and assumes the rest of
136 the stuff in the index record is OK (pretty safe because we do
137 CRC32 checks on index records now)
138
139 -sAdded, skip the stat call, so reconstruct doesn't even check the
140 message file size - just that a file with the correct name exists
141 at all
142
143 -nAdded, don't make any changes, just report what would have been
144 done if -n wasn't specified
145
146 If you try to use -k or -g, you will get a warning but the
147 reconstruct will still run.
148
149 Upgrading from 2.3.15
150
151 * The SQL detection code in configure has been reworked. Separate
152 options for the include directories and lib directories have been
153 added. Previous SQL options may not work as expected.
154
155 Upgrading from 2.3.10
156
157 * STARTTLS is now allowed for externally preauth'd LMTP connections.
158 If you don't want STARTTLS to be advertised and used by preauth'd
159 clients, you can set <service_name>_tls_cert_file: disabled in
160 imapd.conf.
161
162 Upgrading from 2.3.9
163
164 * The method used for generating Globally Unique IDentifiers used for
165 replication has been changed to be the SHA1 hash of the messages.
166 If you wish to upgrade the existing GUIDs in particular mailbox(es)
167 or the entire server, perform the following steps in the listed
168 order. Note that is is NOT REQUIRED that existing GUIDs be
169 upgraded.
170
171 1. Zero GUIDs on the replica (reconstruct -g)
172 2. Regenerate GUIDs on the master (reconstruct -G)
173 3. Regenerate GUIDs on the replica (reconstruct -G)
174
175 Upgrading from 2.3.8
176
177 * You must install and configure Cyrus SASL version 2.1.17 or later
178 to use Cyrus IMAP 2.3.9 and later. You can download SASL at
179 http://www.cyrusimap.org/mediawiki/index.php/Downloads#SASL_Library.
180 * The default value of the allowplaintext option has been changed to
181 disabled (0). If you need to allow cleartext passwords on the wire,
182 then you will have to explicitly enable the allowplaintext option
183 in imapd.conf.
184
185 Upgrading from 2.3.3 or later (64-bit machines)
186
187 * Due to byte alignment issues in cyrus.index, all mailboxes will
188 have to be reconstructed.
189
190 Upgrading from 2.3.4 or 2.3.5
191
192 * Any mailboxes which had messages appended/delivered/copied with a
193 2.3.4 service or copied with a 2.3.5 imapd MUST be reconstructed in
194 order for the new messages to be displayed by clients.
195
196 Upgrading from 2.2.x or earlier
197
198 * If you wish to use separate metadata partition(s), you MUST first
199 shut down Cyrus and then perform the following:
200
201 1. Set the metapartition-* and metapartition_files options to suit
202 your configuration. For a full description of these options,
203 see the imapd.conf(5) man page.
204 2. Create the metadata partition directory(s) listed in the
205 metapartition-* option(s), setting the ownership and
206 permissions in same fashion as step 6 of install-configure.
207 3. Run the tools/migrate-metadata script (as the cyrus user) to
208 move the metadata files listed in the metapartition_files
209 option from the spool partition(s) to the new metadata
210 partition(s). This script may take a long time to run depending
211 on the number of mailboxes on the server, but presumably the
212 metadata partitions are located on high speed storage, so the
213 writes should be relatively fast.
214 4. Restart Cyrus.
215
216 Upgrading from 2.2.2 or earlier
217
218 * The Cyrus database backend configuration is now handled at runtime
219 using imapd.conf options. If you are not using the default backend
220 for any of the databases, make sure that you specify the correct
221 backend(s) in appropriate option(s).
222 * The format of the newspeer option has been changed. The existing
223 format will still be parsed, but the option should be upgraded to
224 use the new format (see imapd.conf(5) for details).
225
226 Upgrading from 2.2.1 or earlier
227
228 * The sieve bytecode format has changed again to correct an issue
229 with the short circuiting of the allof and anyof operators. To
230 upgrade existing scripts (outside of home directories), you can run
231 the tools/masssievec perl script included with the distribution. It
232 requires a path to your sievec binary. This should also upgrade
233 scripts that have already been compiled to bytecode. For example:
234
235 masssievec /usr/src/cyrus/sieve/sievec
236
237 Upgrading from 2.2.0 or earlier
238
239 * The improved directory hashing (fulldirhash) is now a runtime
240 configuration option. If you are currently using this feature, then
241 make sure that you enable the fulldirhash option in imapd.conf.
242 * The format of mailbox index files has changed. They are upgraded on
243 the fly, so you need to do nothing to upgrade. However, to
244 downgrade them you will need to remove the cyrus.index files, and
245 reconstruct the mailboxes, otherwise the index files will be
246 invalid.
247 * ctl_deliver -E has been deprecated in favor of cyr_expire -E. This
248 new tool does both duplicate delivery database pruning as well as
249 message expunging. You should replace the appropriate EVENTS entry
250 in cyrus.conf with one of those in the sample configurations in the
251 master/conf directory.
252 * The sieve bytecode format has changed. The new format is encoded in
253 network byte order, and will be transferable between architechures.
254 To upgrade existing scripts (outside of home directories), you can
255 run the tools/masssievec perl script included with the
256 distribution. It requires a path to your sievec binary. This should
257 also upgrade scripts that have already been compiled to bytecode.
258 For example:
259
260 masssievec /usr/src/cyrus/sieve/sievec
261
262 Upgrading from 2.1.x or earlier
263
264 General information (ALL SITES)
265
266 * The default database formats for the mailbox list and the seen
267 state databases has been changed to the skiplist backend. There are
268 two ways of dealing with this if you have been using the defaults.
269
270 1. Specify --with-mboxlist-db=berkeley and --with-seen-db=flat to
271 configure. This will instruct Cyrus to continue to use the
272 previous defaults.
273 2. Use the cvt_cyrusdb program to directly convert the databases.
274 This should be done with the server down, and with the binaries
275 from the new Cyrus distribution. Change any paths that do not
276 match your configuration.
277 For the mailbox list, the command looks like:
278
279 /usr/cyrus/bin/cvt_cyrusdb /var/imap/mailboxes.db berkeley /var/imap/mailboxes.db.new skiplist
280 mv /var/imap/mailboxes.db.new /var/imap/mailboxes.db
281
282 Note that the use of full paths to the database files is
283 important. You should also backup your old mailboxes database
284 before moving the new one in.
285 For the seen state databases, the command to get them all in
286 one fell swoop looks like:
287
288 find /var/imap/user -name \*.seen -exec /usr/cyrus/bin/cvt_cyrusdb \{\} flat \{\}.new skiplist \; -exec mv \{\}.new \{\} \;
289
290 The slashes are important for shell escaping. Again, you should
291 back up the contents of your /var/imap/user directory before
292 executing this command. These commands may take some time to
293 complete, especially if your databases are large.
294
295 We believe that skiplist offers considerable performance advantages
296 for these two databases over the previous defaults.
297 * Sieve scripts are now compiled into bytecode. The program sievec is
298 provided to do this process manually (timsieved will compile
299 submitted sieve scripts as they are uploaded). To upgrade existing
300 scripts (outside of home directories), you can run the
301 tools/masssievec perl script included with the distribution. It
302 requires a path to your sievec binary. For example:
303
304 masssievec /usr/src/cyrus/sieve/sievec
305
306 Note that this will fail for scripts that use the "envelope"
307 extention but do not require it. Cyrus 2.1's timsieved did not do
308 appropriate checking that the optional envelope test was required
309 before it was used.
310 * Configuration subsystem changes:
311
312 * The tls_[service]_* configuration options have been removed.
313 Now use [servicename]_tls_*, where servicename is the service
314 identifier from cyrus.conf for that particular process.
315 * The admins and lmtp_admins configuration options no longer
316 union. Per-service options completely override the default
317 value when they are specified.
318 * lmtp_allowplaintext is no longer a defined parameter and must
319 be specified using the service name of your lmtp process if you
320 require a specific value.
321
322 Specialized information (Murder, AFS, etc.)
323
324 * The IMAP IDLE command is now supported by proxyd and is controlled
325 by the imapidlepoll option, which is enabled by default (60
326 seconds). To disable IMAP IDLE in proxyd, set imapidlepoll to 0.
327 * User moves via RENAME and XFER are now controlled by the
328 allowusermoves option, which defaults to off.
329 * If you use ptloader, it now runs as a regular cyrus service. This
330 means that you will need master to acquire and maintain AFS tokens
331 for it. You will also need to create the ptclient directory under
332 your imap configdirectory, to hold the PTS cache (now a
333 full-fledged cyrusdb) and UNIX socket. In cyrus.conf, ptloader
334 should be setup to listen on <configdirectory>/ptclient/ptsock. See
335 the master/test/cmu-backend.conf example configuration file.
336 * Also, ptloader has been given a generic interface. You should now
337 specify "--with-auth=pts" (instead of "--with-auth=krb_pts") to
338 configure. There is also a --with-pts= configure option that
339 defaults to afskrb (Kerberos Canonicalization, AFS PTS Groups).
340 There is also an experimental ldap module. Note also that if
341 ptloader fails the lookup, authorization (and therefore
342 authentication) will now fail, as canonicalization is done inside
343 of ptloader.
344 * The format of sieve referrals has changed to be more consistant
345 with the current managesieve draft, this may cause interoperability
346 problems when using managesieve clients and servers from different
347 cyrus versions.
348 * Clients that use old-style ACL commands that include the "MAILBOX"
349 directive will no longer function. We do not know of any clients
350 that have this problem currently.
351 * Any applications that link libcyrus.a now need to link
352 libcyrus_min.a as well.
353
354 Upgrading from 2.1.13 or earlier
355
356 * We are now more forgiving of MIME boundry headers generated by
357 earlier versions of eudora. However, if you have messages already
358 in the mailstore that you want to fix you will need to reconstruct
359 the affected mailboxes to regenerate the cached bodystructure data
360 to take this into account. Nothing needs to be done for new
361 messages to be treated in this way.
362
363 Upgrading from 2.1.12 or earlier
364
365 * timsieved was corrected to behave properly in the altnamespace
366 configuration. However, this means that it was previously looking
367 for sieve scripts in "user.name" format instead of the (correct)
368 "user^name" format. A sample script to do this (which should be run
369 in the top level of the sieve directory) is in
370 tools/convert-sieve.pl. Note that this is only needed if you are
371 running with altnamespace turned on.
372
373 Upgrading from 2.1.3 or earlier
374
375 * If you use notifications (previously notify_zephyr or notify_unix)
376 this functionality has been seperated out to notifyd. See the
377 notifyd manpage and example entries in master/conf.
378
379 Upgrading from 2.1.2 or earlier
380
381 * Sieve has been updated to be compliant with RFC 3028 and
382 draft-martin-sieve-notify-01. All notify actions and any fileinto
383 and/or redirect actions using stringlists will have to be
384 updated/changed.
385
386 Upgrading from 2.0.16 or earlier
387
388 * You must install and configure Cyrus SASL version 2 to use Cyrus
389 IMAP 2.1 and later. You can download SASL at
390 http://www.cyrusimap.org/mediawiki/index.php/Downloads#SASL_Library.
391 * If you use timsieved to manage Sieve scripts, and have enabled the
392 alternate namespace and/or the Unix hierarchy separator, run the
393 script "tools/translatesieve". This script will translate the
394 folder names in fileinto actions.
395 * Cyrus now uses the service name "sieve" instead of "imap" for the
396 SASL profile of timsieved. If you use timsieved to manage Sieve
397 scripts, be sure to update your password checking mechanism
398 appropriately,
399 * If you have enabled the improved directory hashing scheme, run the
400 script "tools/rehash full". This script will rehash your existing
401 directories.
402 * The hashed deliver databases (used for duplicate delivery
403 suppression and Sieve) have been merged into a single deliver.db
404 database. You can safely remove the entire /var/imap/deliverdb
405 directory structure after shutting down the server.
406 * All of the Cyrus databases have been unified under a single BDB
407 environment. A new ctl_cyrusdb tool is now used for database
408 recovery and checkpointing instead of ctl_mboxlist and ctl_deliver.
409 You should replace the appropriate START and EVENTS entries in
410 cyrus.conf with those in the sample configurations in the
411 master/conf directory.
412 * Cyrus now caches SSL/TLS sessions in an external database. If you
413 have support for SSL/TLS, and haven't disabled session caching (see
414 imapd.conf(5)), you should add a line like the following to the
415 EVENTS section of cyrus.conf to prune expired sessions from the
416 database:
417
418 # this is only necessary if caching TLS sessions
419 tlsprune cmd="tls_prune" period=1440
420
421 Upgrading from 2.0.6, 2.0.7, 2.0.8, or 2.0.9 or earlier
422
423 * If you use timsieved to manage Sieve scripts, run the script
424 "tools/upgradesieve". timsieved now uses symlinks instead of hard
425 links.
426
427 Upgrading from a previous 2.0 version to 2.0.6
428
429 Warning: You do not need to follow these instructions if you're
430 upgrading from version 1.6.
431
432 * You can now pick whether to use Berkeley db to store seen state,
433 the subscription files, and the mailboxes file or a flat text file,
434 at compile time only. (Look in imap/seen_db.c and imap/mboxlist.h.)
435 * The format of the mailboxes file and seen state has changed. It is
436 not possible to preserve seen state, but upgrade the mailboxes file
437 as follows:
438
439 1. Run ctl_mboxlist -d > mboxlist.temp to dump existing mailboxes.
440 2. Remove old database files: rm mailboxes.db db/* user/*/*.seen
441 3. With the new version of ctl_mboxlist, run ctl_mboxlist -u <
442 mboxlist.temp.
443
444 Upgrading from 1.6.22 or 1.6.24
445
446 Warning: Cyrus imapd 2.0 will automatically convert on-disk file
447 formats as the server is used. It is not possible to run 1.6 after 2.0
448 has been used on a mail spool without reconstructing every mailbox.
449
450 * Create some extra directories and remove the duplicate delivery
451 database:
452
453 mkdir /var/imap/db
454 mkdir /var/imap/socket
455 chown cyrus /var/imap/db /var/imap/socket
456 rm -rf /var/imap/deliverdb
457
458 * Convert mailboxes file to Berkeley DB:
459
460 su cyrus
461 cd /var/imap
462 ctl_mboxlist -u < mailboxes
463 ctl_cyrusdb -c
464
465 Please keep a backup of your mailboxes file. You can dump an
466 old-style mailboxes file by using ctl_mboxlist -d.
467 * remove "/etc/inetd.conf" entries. The imap and popd3d lines need to
468 be removed from /etc/inetd.conf and inetd needs to be restarted.
469 * master process configuration: You'll need to configure the master
470 process Cyrus process and ensure that it starts on boot. see this
471 section of the configuration instructions.
472 * MTA configuration. You will have to reconfigure your MTA to speak
473 to lmtpd. See this section of the configuration document.
474 * cyrus.seen conversion. The cyrus.seen file will be automatically
475 upgraded as users read mail. After some time, you might want to
476 delete the cyrus.seen file in each mailbox; it is superceded by the
477 user/joe.seen file.
478 * cyrus.index conversion. The cyrus.index file will be automatically
479 upgraded the first time each mailbox is SELECTed.
480 * Netnews conversion. The netnews programs are no longer built. If
481 you are using netnews, you will need to apply the diff in the
482 netnews/ directory to INN or see if INN is now distributing those
483 changes. You will also want to run remotepurge on a regular basis
484 to purge old netnews posts.
485
486 Upgrading from 1.6.13
487
488 * Upgrading from the Cyrus IMAP server version 1.6.13 or earlier: if
489 you use Sieve, you should run the "tools/upgradesieve" script, as
490 the format of the "/usr/sieve" directory has changed slightly.
491
492 timsieved, included in this release, will handle maintenance of
493 Sieve scripts.
494 * Upgrading from the Cyrus IMAP server version 1.6.10 or earlier: if
495 you export news via the IMAP server, you'll have to change your
496 "newsfeeds" file to contain
497
498 collectnews!:*:Tf,WR:collectnews
499
500 The format of the input to collectnews has changed.
501
502 Duplicate delivery suppression is now required for Sieve.
503 * Upgrading from the Cyrus IMAP server version 1.6.1 or earlier
504 (including 1.5.x!): the quota and user directories are now hashed
505 by the first character of the username. This is to reduce the
506 number of entries in any given directory. It doesn't do a great job
507 (and in some cases it will do a really poor job) but as a quick
508 hack it shouldn't make things worse. Optionally, the data
509 partitions can also be hashed by enabling the "hashimapspool"
510 option.
511
512 You must hash your directories using the "dohash" script in the
513 tools subdirectory. (If you want to hash your mail spool, be sure
514 to set "hashimapspool" before running "dohash".) This must be run
515 as the Cyrus user. Be sure to stop mail service while converting.
516 Doing this in single user mode is probably the safest.
517
518 Upgrading from 1.5
519
520 * Upgrading from the Cyrus IMAP server version 1.5 or earlier:
521 libsasl is now required. Configuring SASL to work may be a chore,
522 especially if you use shadow passwords.
523 * An ANSI C compiler is now required. gcc should work fine and can be
524 acquired from http://www.gnu.org/software/gcc/gcc.html.
525 * Make sure to read the upgrading instructions under 1.6 above.
526 * Upgrading from 1.5.14 or earlier requires deleting the delivered
527 database. Remove the file delivered.db in the configdirectory and
528 make a directory called "deliverdb" in the configdirectory. This
529 may cause some duplicates to get through.
530 * Upgrading from 1.5.14 or earlier requires removing the PTS cache
531 database (if the AFS PTS group support is used, which is not the
532 default). The PTS cache is in /var/ptclient/ptscache.db, and you
533 should remove it. This is because the format for the PTS cache for
534 IMSP has changed. If you use AFS ACLs, IMSPd, and IMAPd on the same
535 machine, make sure you have version 1.5a5 of the IMSP server for
536 this version of the IMAP server. (If you don't have IMSP, or AFS,
537 don't worry about it.)
538
6565
6666 RFC 5524 Extended URLFETCH for Binary and Converted Parts
6767
68 draft-daboo-imap-annotatemore IMAP ANNOTATEMORE Extension
68 draft-daboo-imap-annotatemore ANNOTATEMORE Draft
69
70 RFC 5464 The IMAP METADATA Extension
71
72 draft-ietf-morg-list-specialuse IMAP SPECIALUSE Draft (And non-standard
73 Google XLIST support)
74
75 RFC 5819 IMAP4 Extension for Returning STATUS Information in Extended
76 LIST
77
78 RFC 5957 Display-Based Address Sorting for the IMAP4 SORT Extension
6979
7080 POP
7181
455455 if (destfile) {
456456 /* this will hopefully ensure that the link() actually happened
457457 and makes sure that the file actually hits disk */
458 r = fsync(fileno(destfile));
458 fsync(fileno(destfile));
459459 fclose(destfile);
460460 }
461461 if (r) {
120120 return r;
121121 }
122122
123 time_t duplicate_check(char *id, int idlen, const char *to, int tolen)
123 time_t duplicate_check(duplicate_key_t *dkey)
124124 {
125125 char buf[1024];
126 int idlen = strlen(dkey->id);
127 int tolen = strlen(dkey->to);
128 int datelen = strlen(dkey->date);
126129 int r;
127130 const char *data = NULL;
128131 int len = 0;
130133
131134 if (!duplicate_dbopen) return 0;
132135
133 if (idlen + tolen > (int) sizeof(buf) - 30) return 0;
134 memcpy(buf, id, idlen);
136 if (idlen + tolen + datelen > (int) sizeof(buf) - 30) return 0;
137 memcpy(buf, dkey->id, idlen);
135138 buf[idlen] = '\0';
136 memcpy(buf + idlen + 1, to, tolen);
139 memcpy(buf + idlen + 1, dkey->to, tolen);
137140 buf[idlen + tolen + 1] = '\0';
141 assert(dkey->date != NULL);
142 memcpy(buf + idlen + tolen + 2, dkey->date, datelen);
143 buf[idlen + tolen + datelen + 2] = '\0';
138144
139145 do {
140146 r = DB->fetch(dupdb, buf,
141 idlen + tolen + 2, /* +2 b/c 1 for the center null;
142 +1 for the terminating null */
147 idlen + tolen + datelen + 3, /* We have three concatenated values now, all parts ending with '\0' */
143148 &data, &len, NULL);
144149 } while (r == CYRUSDB_AGAIN);
145150
151156 memcpy(&mark, data, sizeof(time_t));
152157 } else if (r != CYRUSDB_OK) {
153158 if (r != CYRUSDB_NOTFOUND) {
154 syslog(LOG_ERR, "duplicate_check: error looking up %s/%s: %s",
155 id, to,
156 cyrusdb_strerror(r));
159 syslog(LOG_ERR, "duplicate_check: error looking up %s/%s/%s: %s",
160 dkey->id, dkey->to, dkey->date,
161 cyrusdb_strerror(r));
157162 }
158163 mark = 0;
159164 }
160165
161 syslog(LOG_DEBUG, "duplicate_check: %-40s %-20s %ld",
162 buf, buf+idlen+1, mark);
166 syslog(LOG_DEBUG, "duplicate_check: %-40s %-20s %-40s %ld",
167 buf, buf+idlen+1, buf+idlen+tolen+2, mark);
163168
164169 return mark;
165170 }
166171
167 void duplicate_log(char *msgid, const char *name, char *action)
168 {
169 syslog(LOG_INFO, "dupelim: eliminated duplicate message to %s id %s (%s)",
170 name, msgid, action);
172 void duplicate_log(duplicate_key_t *dkey, char *action)
173 {
174 assert(dkey->date != NULL);
175 syslog(LOG_INFO, "dupelim: eliminated duplicate message to %s id %s date %s (%s)",
176 dkey->to, dkey->id, dkey->date, action);
171177 if (config_auditlog)
172 syslog(LOG_NOTICE, "auditlog: duplicate sessionid=<%s> action=<%s> message-id=%s user=<%s>",
173 session_id(), action, msgid, name);
174 }
175
176 void duplicate_mark(char *id, int idlen, const char *to, int tolen, time_t mark,
177 unsigned long uid)
178 syslog(LOG_NOTICE, "auditlog: duplicate sessionid=<%s> action=<%s> message-id=%s user=<%s> date=<%s>",
179 session_id(), action, dkey->id, dkey->to, dkey->date);
180 }
181
182 void duplicate_mark(duplicate_key_t *dkey, time_t mark, unsigned long uid)
178183 {
179184 char buf[1024], data[100];
185 int idlen = strlen(dkey->id);
186 int tolen = strlen(dkey->to);
187 int datelen = strlen(dkey->date);
180188 int r;
181189
182190 if (!duplicate_dbopen) return;
183191
184 if (idlen + tolen > (int) sizeof(buf) - 30) return;
185 memcpy(buf, id, idlen);
192 if (idlen + tolen + datelen > (int) sizeof(buf) - 30) return;
193 memcpy(buf, dkey->id, idlen);
186194 buf[idlen] = '\0';
187 memcpy(buf + idlen + 1, to, tolen);
195 memcpy(buf + idlen + 1, dkey->to, tolen);
188196 buf[idlen + tolen + 1] = '\0';
197 assert(dkey->date != NULL);
198 memcpy(buf + idlen + tolen + 2, dkey->date, datelen);
199 buf[idlen + tolen + datelen + 2] = '\0';
189200
190201 memcpy(data, &mark, sizeof(mark));
191202 memcpy(data + sizeof(mark), &uid, sizeof(uid));
192203
193204 do {
194205 r = DB->store(dupdb, buf,
195 idlen + tolen + 2, /* +2 b/c 1 for the center null;
196 +1 for the terminating null */
206 idlen + tolen + datelen + 3, /* We have three concatenated values now, all parts ending with '\0' */
197207 data, sizeof(mark)+sizeof(uid), NULL);
198208 } while (r == CYRUSDB_AGAIN);
199209
200 syslog(LOG_DEBUG, "duplicate_mark: %-40s %-20s %ld %lu",
201 buf, buf+idlen+1, mark, uid);
210 syslog(LOG_DEBUG, "duplicate_mark: %-40s %-20s %-40s %ld %lu",
211 buf, buf+idlen+1, buf+idlen+tolen+2, mark, uid);
202212
203213 return;
204214 }
4848 /* name of the duplicate delivery database */
4949 #define FNAME_DELIVERDB "/deliver.db"
5050
51 typedef struct duplicate_key {
52 const char *id;
53 const char *to;
54 const char *date;
55 } duplicate_key_t;
56
57 #define DUPLICATE_INITIALIZER { NULL, NULL, NULL }
58
5159 int duplicate_init(const char *fname, int myflags);
5260
53 time_t duplicate_check(char *id, int idlen, const char *to, int tolen);
54 void duplicate_log(char *msgid, const char *name, char *action);
55 void duplicate_mark(char *id, int idlen, const char *to, int tolen, time_t mark,
56 unsigned long uid);
61 time_t duplicate_check(duplicate_key_t *dkey);
62 void duplicate_log(duplicate_key_t *dkey, char *action);
63 void duplicate_mark(duplicate_key_t *dkey, time_t mark, unsigned long uid);
5764 int duplicate_find(char *msgid, int (*proc)(), void *rock);
5865
5966 int duplicate_prune(int seconds, struct hash_table *expire_table);
298298 { "ESEARCH", 2 },
299299 { "SORT", 2 },
300300 { "SORT=MODSEQ", 2 },
301 { "SORT=DISPLAY", 2 },
301302 { "THREAD=ORDEREDSUBJECT", 2 },
302303 { "THREAD=REFERENCES", 2 },
303304 { "ANNOTATEMORE", 2 },
71007101 sawone[NAMESPACE_INBOX] =
71017102 !mboxlist_lookup(inboxname, NULL, NULL);
71027103 }
7103 sawone[NAMESPACE_USER] = 1;
7104 sawone[NAMESPACE_SHARED] = 1;
7104 sawone[NAMESPACE_USER] = imapd_userisadmin ? 1 : imapd_namespace.accessible[NAMESPACE_USER];
7105 sawone[NAMESPACE_SHARED] = imapd_userisadmin ? 1 : imapd_namespace.accessible[NAMESPACE_SHARED];
71057106 } else {
71067107 pattern = xstrdup("%");
71077108 /* now find all the exciting toplevel namespaces -
91419142 (*sortcrit)[n].key = SORT_CC;
91429143 else if (!strcmp(criteria.s, "date"))
91439144 (*sortcrit)[n].key = SORT_DATE;
9145 else if (!strcmp(criteria.s, "displayfrom"))
9146 (*sortcrit)[n].key = SORT_DISPLAYFROM;
9147 else if (!strcmp(criteria.s, "displayto"))
9148 (*sortcrit)[n].key = SORT_DISPLAYTO;
91449149 else if (!strcmp(criteria.s, "from"))
91459150 (*sortcrit)[n].key = SORT_FROM;
91469151 else if (!strcmp(criteria.s, "size"))
217217 SORT_ARRIVAL,
218218 SORT_CC,
219219 SORT_DATE,
220 SORT_DISPLAYFROM,
221 SORT_DISPLAYTO,
220222 SORT_FROM,
221223 SORT_SIZE,
222224 SORT_SUBJECT,
142142 static void index_checkflags(struct index_state *state, int dirty);
143143 static char *find_msgid(char *str, char **rem);
144144 static char *get_localpart_addr(const char *header);
145 static char *get_displayname(const char *header);
145146 static char *index_extract_subject(const char *subj, size_t len, int *is_refwd);
146147 static char *_index_extract_subject(char *s, int *is_refwd);
147148 static void index_get_ids(MsgData *msgdata,
173174 struct vanished_params *params);
174175 static struct seqset *_parse_sequence(struct index_state *state,
175176 const char *sequence, int usinguid);
177 static void massage_header(char *hdr);
176178
177179 /* NOTE: Make sure these are listed in CAPABILITY_STRING */
178180 static const struct thread_algorithm thread_algs[] = {
13491351 if (CONFIG_TIMING_VERBOSE) {
13501352 int len;
13511353 char *key_names[] = { "SEQUENCE", "ARRIVAL", "CC", "DATE", "FROM",
1352 "SIZE", "SUBJECT", "TO", "ANNOTATION", "MODSEQ" };
1354 "SIZE", "SUBJECT", "TO", "ANNOTATION", "MODSEQ",
1355 "DISPLAYFROM", "DISPLAYTO" };
13531356 char buf[1024] = "";
13541357
13551358 while (sortcrit->key && sortcrit->key < VECTOR_SIZE(key_names)) {
35043507 for (j = 0; sortcrit[j].key; j++) {
35053508 label = sortcrit[j].key;
35063509
3507 if ((label == SORT_CC ||
3510 if ((label == SORT_CC || label == SORT_DATE ||
35083511 label == SORT_FROM || label == SORT_SUBJECT ||
3509 label == SORT_TO || label == LOAD_IDS) &&
3512 label == SORT_TO || label == LOAD_IDS ||
3513 label == SORT_DISPLAYFROM || label == SORT_DISPLAYTO) &&
35103514 !did_cache) {
35113515
35123516 /* fetch cached info */
35773581 index_get_ids(cur, envtokens, cacheitem_base(&im->record, CACHE_HEADERS),
35783582 cacheitem_size(&im->record, CACHE_HEADERS));
35793583 break;
3584 case SORT_DISPLAYFROM:
3585 cur->displayfrom = get_displayname(
3586 cacheitem_base(&im->record, CACHE_FROM));
3587 break;
3588 case SORT_DISPLAYTO:
3589 cur->displayto = get_displayname(
3590 cacheitem_base(&im->record, CACHE_TO));
3591 break;
35803592 }
35813593 }
35823594
35863598 return md;
35873599 }
35883600
3589 /*
3590 * Get the 'local-part' of an address from a header
3591 */
35923601 static char *get_localpart_addr(const char *header)
35933602 {
35943603 struct address *addr = NULL;
35953604 char *ret;
35963605
35973606 parseaddr_list(header, &addr);
3598 ret = xstrdup(addr && addr->mailbox ? addr->mailbox : "");
3607 if (!addr) return xstrdup("");
3608
3609 if (addr->mailbox) {
3610 ret = xstrdup(addr->mailbox);
3611 }
3612 else {
3613 ret = xstrdup("");
3614 }
3615
35993616 parseaddr_free(addr);
3617
3618 return ret;
3619 }
3620
3621 /*
3622 * Get the 'display-name' of an address from a header
3623 */
3624 static char *get_displayname(const char *header)
3625 {
3626 struct address *addr = NULL;
3627 char *ret;
3628
3629 parseaddr_list(header, &addr);
3630 if (!addr) return xstrdup("");
3631
3632 if (addr->name && addr->name[0]) {
3633 char *p;
3634 ret = xstrdup(addr->name);
3635 for (p = ret; *p; p++)
3636 *p = toupper(*p);
3637 }
3638 else if (addr->domain && addr->mailbox) {
3639 /* mailbox@domain */
3640 int len = strlen(addr->mailbox) + strlen(addr->domain) + 2;
3641 ret = xmalloc(len);
3642 snprintf(ret, len, "%s@%s", addr->mailbox, addr->domain);
3643 }
3644 else if (addr->mailbox) {
3645 ret = xstrdup(addr->mailbox);
3646 }
3647 else {
3648 ret = xstrdup("");
3649 }
3650
3651 parseaddr_free(addr);
3652
36003653 return ret;
36013654 }
36023655
36433696 base = xstrdup(base);
36443697
36453698 free(buf);
3699
3700 for (s = base; *s; s++) {
3701 *s = toupper(*s);
3702 }
36463703
36473704 return base;
36483705 }
39053962 /* allocate some space for refs */
39063963 msgdata->ref = (char **) xmalloc(refsize * sizeof(char *));
39073964 /* find references */
3965 massage_header(buf);
39083966 refstr = buf;
39093967 while ((ref = find_msgid(refstr, &refstr)) != NULL) {
39103968 /* reallocate space for this msgid if necessary */
40014059 case SORT_MODSEQ:
40024060 ret = numcmp(md1->modseq, md2->modseq);
40034061 break;
4062 case SORT_DISPLAYFROM:
4063 ret = strcmp(md1->displayfrom, md2->displayfrom);
4064 break;
4065 case SORT_DISPLAYTO:
4066 ret = strcmp(md1->displayto, md2->displayto);
4067 break;
40044068 }
40054069 } while (!ret && sortcrit[i++].key != SORT_SEQUENCE);
40064070
40204084 FREE(md->cc);
40214085 FREE(md->from);
40224086 FREE(md->to);
4087 FREE(md->displayfrom);
4088 FREE(md->displayto);
40234089 FREE(md->xsubj);
40244090 FREE(md->msgid);
40254091 for (i = 0; i < md->nref; i++)
144144 char *cc; /* local-part of first "cc" address */
145145 char *from; /* local-part of first "from" address */
146146 char *to; /* local-part of first "to" address */
147 char *displayfrom; /* display-name of first "from" address */
148 char *displayto; /* display-name of first "to" address */
147149 char *xsubj; /* extracted subject text */
148150 unsigned xsubj_hash; /* hash of extracted subject text */
149151 int is_refwd; /* is message a reply or forward? */
8181 int exact = -1;
8282 int pattern = -1;
8383 int skipflagged = 0;
84 int onlydeleted = 0;
8485 int use_sentdate = 1;
8586 int invertmatch = 0;
8687
117118 fatal("must run as the Cyrus user", EC_USAGE);
118119 }
119120
120 while ((option = getopt(argc, argv, "C:hxd:b:k:m:fsXi")) != EOF) {
121 while ((option = getopt(argc, argv, "C:hxd:b:k:m:fsXio")) != EOF) {
121122 switch (option) {
122123 case 'C': /* alt config file */
123124 alt_config = optarg;
160161 } break;
161162 case 'i' : {
162163 invertmatch = 1;
164 } break;
165 case 'o' : {
166 onlydeleted = 1;
163167 } break;
164168 case 'h':
165169 default: usage(argv[0]);
218222
219223 int
220224 usage(char *name) {
221 printf("usage: %s [-f] [-s] [-C <alt_config>] [-x] [-X] [-i] {-d days | -b bytes|-k Kbytes|-m Mbytes}\n\t[mboxpattern1 ... [mboxpatternN]]\n", name);
225 printf("usage: %s [-f] [-s] [-C <alt_config>] [-x] [-X] [-i] [-o] {-d days | -b bytes|-k Kbytes|-m Mbytes}\n\t[mboxpattern1 ... [mboxpatternN]]\n", name);
222226 printf("\tthere are no defaults and at least one of -d, -b, -k, -m\n\tmust be specified\n");
223227 printf("\tif no mboxpattern is given %s works on all mailboxes\n", name);
224228 printf("\t -x specifies an exact match for days or size\n");
226230 printf("\t -s skip over messages that are flagged.\n");
227231 printf("\t -X use delivery time instead of date header for date matches.\n");
228232 printf("\t -i invert match logic: -x means not equal, date is for newer, size is for smaller.\n");
233 printf("\t -o only purge messages that are deleted.\n");
229234 exit(0);
230235 }
231236
293298 if (skipflagged && record->system_flags & FLAG_FLAGGED)
294299 return 0;
295300
301 if (onlydeleted && !(record->system_flags & FLAG_DELETED))
302 return 0;
303
296304 if (exact == 1) {
297305 if (days >= 0) {
298306 /* printf("comparing %ld :: %ld\n", my_time, the_record->sentdate); */
224224 time_t t;
225225 char datestr[80];
226226 pid_t sm_pid, p;
227 duplicate_key_t dkey = DUPLICATE_INITIALIZER;
227228
228229 smbuf[0] = "sendmail";
229230 smbuf[1] = "-i"; /* ignore dots */
243244 global_outgoing_count++, config_servername);
244245
245246 namebuf = make_sieve_db(mailreceip);
246 duplicate_mark(buf, strlen(buf), namebuf, strlen(namebuf), t, 0);
247
248 dkey.id = buf;
249 dkey.to = namebuf;
250 rfc822date_gen(datestr, sizeof(datestr), t);
251 dkey.date = datestr;
252 duplicate_mark(&dkey, t, 0);
247253 fprintf(sm, "Message-ID: %s\r\n", buf);
248
249 rfc822date_gen(datestr, sizeof(datestr), t);
250254 fprintf(sm, "Date: %s\r\n", datestr);
251255
252256 fprintf(sm, "X-Sieve: %s\r\n", SIEVE_VERSION);
367371 script_data_t *sd = (script_data_t *) sc;
368372 message_data_t *m = ((deliver_data_t *) mc)->m;
369373 char buf[8192], *sievedb = NULL;
374 duplicate_key_t dkey = DUPLICATE_INITIALIZER;
370375 int res;
371376
372377 /* if we have a msgid, we can track our redirects */
374379 snprintf(buf, sizeof(buf), "%s-%s", m->id, rc->addr);
375380 sievedb = make_sieve_db(sd->username);
376381
382 dkey.id = buf;
383 dkey.to = sievedb;
384 dkey.date = ((deliver_data_t *) mc)->m->date;
377385 /* ok, let's see if we've redirected this message before */
378 if (duplicate_check(buf, strlen(buf), sievedb, strlen(sievedb))) {
379 duplicate_log(m->id, sd->username, "redirect");
386 if (duplicate_check(&dkey)) {
387 duplicate_log(&dkey, "redirect");
380388 return SIEVE_OK;
381389 }
382390 }
383391
384392 if ((res = send_forward(rc->addr, m->return_path, m->data)) == 0) {
385393 /* mark this message as redirected */
386 if (sievedb) duplicate_mark(buf, strlen(buf),
387 sievedb, strlen(sievedb), time(NULL), 0);
394 if (sievedb) duplicate_mark(&dkey, time(NULL), 0);
388395
389396 snmp_increment(SIEVE_REDIRECT, 1);
390397 syslog(LOG_INFO, "sieve redirected: %s to: %s",
493500 fc->imapflags->flag, fc->imapflags->nflags,
494501 (char *) sd->username, sd->authstate, md->id,
495502 sd->username, mdata->notifyheader,
496 namebuf, quotaoverride, 0);
503 namebuf, md->date, quotaoverride, 0);
497504 }
498505
499506 if (!ret) {
553560 return SIEVE_OK;
554561 }
555562
563 static const char hex[] = "0123456789ABCDEF";
564
556565 static int autorespond(void *ac,
557566 void *ic __attribute__((unused)),
558567 void *sc,
563572 script_data_t *sd = (script_data_t *) sc;
564573 time_t t, now;
565574 int ret;
575 int i;
576 duplicate_key_t dkey = DUPLICATE_INITIALIZER;
577 char *id;
566578
567579 snmp_increment(SIEVE_VACATION_TOTAL, 1);
568580
569581 now = time(NULL);
570582
571583 /* ok, let's see if we've responded before */
572 t = duplicate_check((char *) arc->hash, SIEVE_HASHLEN,
573 sd->username, strlen(sd->username));
584 id = xmalloc(SIEVE_HASHLEN*2 + 1);
585 for (i = 0; i < SIEVE_HASHLEN; i++) {
586 id[i*2+0] = hex[arc->hash[i] / 16];
587 id[i*2+1] = hex[arc->hash[i] % 16];
588 }
589 id[SIEVE_HASHLEN*2] = '\0';
590 dkey.id = id;
591 dkey.to = sd->username;
592 dkey.date = ""; /* no date on these, ID is custom */
593 t = duplicate_check(&dkey);
574594 if (t) {
575595 if (now >= t) {
576596 /* yay, we can respond again! */
584604 }
585605
586606 if (ret == SIEVE_OK) {
587 duplicate_mark((char *) arc->hash, SIEVE_HASHLEN,
588 sd->username, strlen(sd->username),
589 now + arc->days * (24 * 60 * 60), 0);
590 }
607 duplicate_mark(&dkey, now + arc->days * (24 * 60 * 60), 0);
608 }
609
610 free(id);
591611
592612 return ret;
593613 }
606626 sieve_send_response_context_t *src = (sieve_send_response_context_t *) ac;
607627 message_data_t *md = ((deliver_data_t *) mc)->m;
608628 script_data_t *sdata = (script_data_t *) sc;
629 duplicate_key_t dkey = DUPLICATE_INITIALIZER;
609630
610631 smbuf[0] = "sendmail";
611632 smbuf[1] = "-i"; /* ignore dots */
666687 if (sm_stat == 0) { /* sendmail exit value */
667688 sievedb = make_sieve_db(sdata->username);
668689
669 duplicate_mark(outmsgid, strlen(outmsgid),
670 sievedb, strlen(sievedb), t, 0);
690 dkey.id = outmsgid;
691 dkey.to = sievedb;
692 dkey.date = ((deliver_data_t *) mc)->m->date;
693 duplicate_mark(&dkey, t, 0);
671694
672695 snmp_increment(SIEVE_VACATION_REPLIED, 1);
673696
878901 char userbuf[MAX_MAILBOX_BUFFER] = "";
879902 char authuserbuf[MAX_MAILBOX_BUFFER];
880903 int r = 0;
904 duplicate_key_t dkey = DUPLICATE_INITIALIZER;
881905
882906 if (!user) {
883907 /* shared mailbox, check for annotation */
934958 domain ? domain : "");
935959 sdb = make_sieve_db(namebuf);
936960
937 duplicate_mark(msgdata->m->id, strlen(msgdata->m->id),
938 sdb, strlen(sdb), time(NULL), 0);
961 dkey.id = msgdata->m->id;
962 dkey.to = sdb;
963 dkey.date = msgdata->m->date;
964 duplicate_mark(&dkey, time(NULL), 0);
939965 }
940966
941967 /* free everything */
495495 const char *user,
496496 char *notifyheader,
497497 const char *mailboxname,
498 char *date,
498499 int quotaoverride,
499500 int acloverride)
500501 {
502503 struct appendstate as;
503504 unsigned long uid;
504505 const char *notifier;
506 duplicate_key_t dkey = {NULL, NULL, NULL};
505507
506508 r = append_setup(&as, mailboxname,
507509 authuser, authstate, acloverride ? 0 : ACL_POST,
510512 (long) size : 0);
511513
512514 /* check for duplicate message */
515 dkey.id = id;
516 dkey.to = mailboxname;
517 dkey.date = date;
513518 if (!r && id && dupelim && !(as.mailbox->i.options & OPT_IMAP_DUPDELIVER) &&
514 duplicate_check(id, strlen(id), mailboxname, strlen(mailboxname))) {
515 duplicate_log(id, mailboxname, "delivery");
519 duplicate_check(&dkey)) {
520 duplicate_log(&dkey, "delivery");
516521 append_abort(&as);
517522 return 0;
518523 }
538543 syslog(LOG_INFO, "Delivered: %s to mailbox: %s",
539544 id, mailboxname);
540545 if (dupelim && id) {
541 duplicate_mark(id, strlen(id), mailboxname,
542 strlen(mailboxname), time(NULL), uid);
546 duplicate_mark(&dkey, time(NULL), uid);
543547 }
544548 mailbox_close(&mailbox);
545549 }
604608 struct rcpt *rc;
605609 struct backend *remote;
606610 int i = 0;
607 int r = 0;
608611
609612 lt->from = msgdata->return_path;
610613 lt->auth = d->authas[0] ? d->authas : NULL;
626629 remote = proxy_findserver(d->server, &lmtp_protocol, "",
627630 &backend_cached, NULL, NULL, NULL);
628631 if (remote) {
629 r = lmtp_runtxn(remote, lt);
632 int txn_timeout = config_getint(IMAPOPT_LMTPTXN_TIMEOUT);
633 if (txn_timeout)
634 prot_settimeout(remote->in, txn_timeout);
635 lmtp_runtxn(remote, lt);
630636 } else {
631637 /* remote server not available; tempfail all deliveries */
632638 for (rc = d->to, i = 0; i < d->rnum; i++) {
687693 md->size, flag, nflags,
688694 mydata->authuser, mydata->authstate, md->id,
689695 NULL, mydata->notifyheader,
690 namebuf, quotaoverride, 0);
696 namebuf, md->date, quotaoverride, 0);
691697 }
692698
693699 /* case 2: ordinary user */
707713 md->size, flag, nflags,
708714 mydata->authuser, mydata->authstate, md->id,
709715 username, mydata->notifyheader,
710 namebuf, quotaoverride, 0);
716 namebuf, md->date, quotaoverride, 0);
711717 }
712718 if (ret2 == IMAP_MAILBOX_NONEXISTENT && mailboxname &&
713719 config_getswitch(IMAPOPT_LMTP_FUZZY_MAILBOX_MATCH) &&
717723 md->size, flag, nflags,
718724 mydata->authuser, mydata->authstate, md->id,
719725 username, mydata->notifyheader,
720 namebuf, quotaoverride, 0);
726 namebuf, md->date, quotaoverride, 0);
721727 }
722728 if (ret2) {
723729 /* normal delivery to INBOX */
729735 md->size, flag, nflags,
730736 (char *) username, authstate, md->id,
731737 username, mydata->notifyheader,
732 namebuf, quotaoverride, 1);
738 namebuf, md->date, quotaoverride, 1);
733739
734740 if (authstate) auth_freestate(authstate);
735741 }
8888 const char *user,
8989 char *notifyheader,
9090 const char *mailboxname,
91 char *date,
9192 int quotaoverride,
9293 int acloverride);
9394
281281 ret->return_path = NULL;
282282 ret->rcpt = NULL;
283283 ret->rcpt_num = 0;
284 ret->date = NULL;
284285
285286 ret->authuser = NULL;
286287 ret->authstate = NULL;
318319 }
319320 free(m->rcpt);
320321 }
322 if (m->date) {
323 free(m->date);
324 }
321325
322326 if (m->authuser) {
323327 free(m->authuser);
461465 {
462466 char *p, *ret;
463467 int len;
468 int lmtp_strict_rfc2821 = config_getswitch(IMAPOPT_LMTP_STRICT_RFC2821);
464469
465470 p = s;
466471
499504 if (!*++p) return 0;
500505 }
501506 else {
507 if (*p & 128 && !lmtp_strict_rfc2821) {
508 /* this prevents us from becoming a backscatter
509 source if our MTA allows 8bit in local-part
510 of adresses. */
511 *p = 'X';
512 }
502513 if (*p <= ' ' || (*p & 128) ||
503514 strchr("<>()[]\\,;:\"", *p)) return 0;
504515 }
733744 }
734745
735746 /* get date */
736 if (!spool_getheader(m->hdrcache, "date")) {
747 if (!(body = spool_getheader(m->hdrcache, "date"))) {
737748 /* no date, create one */
738749 addbody = xstrdup(datestr);
750 m->date = xstrdup(datestr);
739751 fprintf(f, "Date: %s\r\n", addbody);
740752 spool_cache_header(xstrdup("Date"), addbody, m->hdrcache);
753 }
754 else {
755 m->date = xstrdup(body[0]);
741756 }
742757
743758 if (!m->return_path &&
6464 char *return_path; /* where to return message */
6565 address_data_t **rcpt; /* to recipients of this message */
6666 int rcpt_num; /* number of recipients */
67 char *date; /* date field of header */
6768
6869 /* auth state */
6970 char *authuser;
21392139 /* Append MUST have a message with data */
21402140 assert(record->size);
21412141
2142 /* GUID must not be null */
2143 assert(!message_guid_isnull(&record->guid));
2144
21422145 /* belt AND suspenders - check the previous record too */
21432146 if (mailbox->i.num_records) {
21442147 struct index_record prev;
174174 /* copy out interesting parts */
175175 mbtype = strtol(data, &p, 10);
176176
177 if (*p == ' ') p++;
177 if (!p)
178 return IMAP_IOERROR;
179
180 if (*p == ' ' && (p - data) < datalen) p++;
178181 q = partition;
179 while (*p != ' ') { /* copy out partition name */
182 while (*p != ' ' && (p - data) < datalen) { /* copy out partition name */
180183 *q++ = *p++;
181184 }
182185 *q = '\0';
17541757 return r;
17551758 }
17561759
1760 int mboxlist_allmbox(const char *prefix, foreach_cb *proc, void *rock)
1761 {
1762 int r;
1763 char *search = prefix ? (char *)prefix : "";
1764
1765 r = DB->foreach(mbdb, search, strlen(search), NULL, proc, rock, 0);
1766
1767 return r;
1768 }
1769
17571770 /*
17581771 * Find all mailboxes that match 'pattern'.
17591772 * 'isadmin' is nonzero if user is a mailbox admin. 'userid'
17641777 * case it wants some persistant storage or extra data.
17651778 */
17661779 /* Find all mailboxes that match 'pattern'. */
1767 int mboxlist_findall(struct namespace *namespace __attribute__((unused)),
1780 int mboxlist_findall(struct namespace *namespace,
17681781 const char *pattern, int isadmin, const char *userid,
17691782 struct auth_state *auth_state, int (*proc)(), void *rock)
17701783 {
17801793 char domainpat[MAX_MAILBOX_BUFFER] = ""; /* do intra-domain fetches only */
17811794 char *pat = NULL;
17821795
1796 if (!namespace) namespace = mboxname_get_adminnamespace();
1797
17831798 if (config_virtdomains) {
17841799 char *domain;
17851800
19121927 NULL);
19131928 }
19141929
1915 if(!r) {
1930 if (!r && (isadmin || namespace->accessible[NAMESPACE_USER])) {
19161931 cbrock.find_namespace = NAMESPACE_USER;
19171932 /* switch to pattern with domain prepended */
19181933 glob_free(&cbrock.g);
19571972 char domainpat[MAX_MAILBOX_BUFFER]; /* do intra-domain fetches only */
19581973 char *pat = NULL;
19591974
1975 if (!namespace) namespace = mboxname_get_adminnamespace();
1976
19601977 if (config_virtdomains && userid && (p = strchr(userid, '@'))) {
19611978 userlen = p - userid;
19621979 domainlen = strlen(p); /* includes separator */
20562073 *
20572074 * If "Other Users*" can match pattern, search for those mailboxes next
20582075 */
2059 len = strlen(namespace->prefix[NAMESPACE_USER]);
2060 if(len>0) len--;
2061
2062 if (!strncmp(namespace->prefix[NAMESPACE_USER], pattern,
2076 if (isadmin || namespace->accessible[NAMESPACE_USER]) {
2077 len = strlen(namespace->prefix[NAMESPACE_USER]);
2078 if(len>0) len--;
2079
2080 if (!strncmp(namespace->prefix[NAMESPACE_USER], pattern,
20632081 prefixlen < len ? prefixlen : len)) {
20642082
2065 if (prefixlen < len) {
2066 strlcpy(domainpat+domainlen, pattern+prefixlen,
2083 if (prefixlen < len) {
2084 strlcpy(domainpat+domainlen, pattern+prefixlen,
20672085 sizeof(domainpat)-domainlen);
2068 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2069 }
2070 else {
2086 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2087 }
2088 else {
2089 strlcpy(domainpat+domainlen, "user", sizeof(domainpat)-domainlen);
2090 strlcat(domainpat, pattern+len, sizeof(domainpat));
2091 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2092 }
2093 cbrock.find_namespace = NAMESPACE_USER;
2094 cbrock.inboxoffset = 0;
2095
2096 /* iterate through prefixes matching usermboxname */
20712097 strlcpy(domainpat+domainlen, "user", sizeof(domainpat)-domainlen);
2072 strlcat(domainpat, pattern+len, sizeof(domainpat));
2073 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2074 }
2075 cbrock.find_namespace = NAMESPACE_USER;
2076 cbrock.inboxoffset = 0;
2077
2078 /* iterate through prefixes matching usermboxname */
2079 strlcpy(domainpat+domainlen, "user", sizeof(domainpat)-domainlen);
2080 DB->foreach(mbdb,
2081 domainpat, strlen(domainpat),
2082 &find_p, &find_cb, &cbrock,
2083 NULL);
2084
2085 glob_free(&cbrock.g);
2098 DB->foreach(mbdb,
2099 domainpat, strlen(domainpat),
2100 &find_p, &find_cb, &cbrock,
2101 NULL);
2102
2103 glob_free(&cbrock.g);
2104 }
20862105 }
20872106
20882107 /*
20912110 * search for all remaining mailboxes.
20922111 * just bother looking at the ones that have the same pattern prefix.
20932112 */
2094 len = strlen(namespace->prefix[NAMESPACE_SHARED]);
2095 if(len>0) len--;
2096 if (!strncmp(namespace->prefix[NAMESPACE_SHARED], pattern,
2097 prefixlen < len ? prefixlen : len)) {
2098
2099 cbrock.find_namespace = NAMESPACE_SHARED;
2100 cbrock.inboxoffset = 0;
2101
2102 if (prefixlen <= len) {
2103 /* Skip pattern which matches shared namespace prefix */
2104 for (p = pat+prefixlen; *p; p++) {
2105 if (*p == '%') continue;
2106 else if (*p == '.') p++;
2107 break;
2108 }
2109
2110 if (*pattern && !strchr(pattern, '.') &&
2113 if (isadmin || namespace->accessible[NAMESPACE_SHARED]) {
2114 len = strlen(namespace->prefix[NAMESPACE_SHARED]);
2115 if(len>0) len--;
2116 if (!strncmp(namespace->prefix[NAMESPACE_SHARED], pattern,
2117 prefixlen < len ? prefixlen : len)) {
2118
2119 cbrock.find_namespace = NAMESPACE_SHARED;
2120 cbrock.inboxoffset = 0;
2121
2122 if (prefixlen <= len) {
2123 /* Skip pattern which matches shared namespace prefix */
2124 for (p = pat+prefixlen; *p; p++) {
2125 if (*p == '%') continue;
2126 else if (*p == '.') p++;
2127 break;
2128 }
2129
2130 if (*pattern && !strchr(pattern, '.') &&
21112131 pattern[strlen(pattern)-1] == '%') {
21122132 /* special case: LIST "" *% -- output prefix */
2113 cbrock.checkshared = 1;
2114 }
2115
2116 if ((cbrock.checkshared || prefixlen == len) && !*p) {
2117 /* special case: LIST "" % -- output prefix
2118 (if we have a shared mbox) and quit */
2119 strlcpy(domainpat+domainlen, "*", sizeof(domainpat)-domainlen);
2133 cbrock.checkshared = 1;
2134 }
2135
2136 if ((cbrock.checkshared || prefixlen == len) && !*p) {
2137 /* special case: LIST "" % -- output prefix
2138 (if we have a shared mbox) and quit */
2139 strlcpy(domainpat+domainlen, "*", sizeof(domainpat)-domainlen);
2140 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2141 cbrock.checkshared = 2;
2142 }
2143 else {
2144 strlcpy(domainpat+domainlen, p, sizeof(domainpat)-domainlen);
2145 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2146 }
2147
2148 domainpat[domainlen] = '\0';
2149 DB->foreach(mbdb,
2150 domainpat, domainlen,
2151 &find_p, &find_cb, &cbrock,
2152 NULL);
2153 }
2154 else if (pattern[len] == '.') {
2155 strlcpy(domainpat+domainlen, pattern+len+1,
2156 sizeof(domainpat)-domainlen);
21202157 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2121 cbrock.checkshared = 2;
2122 }
2123 else {
2124 strlcpy(domainpat+domainlen, p, sizeof(domainpat)-domainlen);
2125 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2126 }
2127
2128 domainpat[domainlen] = '\0';
2129 DB->foreach(mbdb,
2130 domainpat, domainlen,
2131 &find_p, &find_cb, &cbrock,
2158
2159 DB->foreach(mbdb,
2160 domainpat, domainlen+prefixlen-(len+1),
2161 &find_p, &find_cb, &cbrock,
21322162 NULL);
2133 }
2134 else if (pattern[len] == '.') {
2135 strlcpy(domainpat+domainlen, pattern+len+1,
2136 sizeof(domainpat)-domainlen);
2137 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2138
2139 DB->foreach(mbdb,
2140 domainpat, domainlen+prefixlen-(len+1),
2141 &find_p, &find_cb, &cbrock,
2142 NULL);
2163 }
21432164 }
21442165 }
21452166
25342555 * is the user's login id. For each matching mailbox, calls
25352556 * 'proc' with the name of the mailbox.
25362557 */
2537 int mboxlist_findsub(struct namespace *namespace __attribute__((unused)),
2558 int mboxlist_findsub(struct namespace *namespace,
25382559 const char *pattern, int isadmin __attribute__((unused)),
25392560 const char *userid, struct auth_state *auth_state,
25402561 int (*proc)(), void *rock, int force)
25522573 char domainpat[MAX_MAILBOX_BUFFER]; /* do intra-domain fetches only */
25532574 char *pat = NULL;
25542575
2576 if (!namespace) namespace = mboxname_get_adminnamespace();
2577
25552578 if (config_virtdomains && userid && (p = strchr(userid, '@'))) {
25562579 userlen = p - userid;
25572580 domainlen = strlen(p); /* includes separator */
26622685 cbrock.usermboxnamelen = 0;
26632686 }
26642687
2665 cbrock.find_namespace = NAMESPACE_USER;
2666 /* switch to pattern with domain prepended */
2667 glob_free(&cbrock.g);
2668 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2669 cbrock.inboxoffset = 0;
2670 if (usermboxnamelen) {
2671 usermboxname[--usermboxnamelen] = '\0';
2672 cbrock.usermboxname = usermboxname;
2673 cbrock.usermboxnamelen = usermboxnamelen;
2674 }
2675 /* search for all remaining mailboxes.
2676 just bother looking at the ones that have the same pattern prefix. */
2677 SUBDB->foreach(subs, domainpat, domainlen + prefixlen,
2678 &find_p, &find_cb, &cbrock, NULL);
2688 if (isadmin || namespace->accessible[NAMESPACE_USER]) {
2689 cbrock.find_namespace = NAMESPACE_USER;
2690 /* switch to pattern with domain prepended */
2691 glob_free(&cbrock.g);
2692 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2693 cbrock.inboxoffset = 0;
2694 if (usermboxnamelen) {
2695 usermboxname[--usermboxnamelen] = '\0';
2696 cbrock.usermboxname = usermboxname;
2697 cbrock.usermboxnamelen = usermboxnamelen;
2698 }
2699 /* search for all remaining mailboxes.
2700 just bother looking at the ones that have the same pattern prefix. */
2701 SUBDB->foreach(subs, domainpat, domainlen + prefixlen,
2702 &find_p, &find_cb, &cbrock, NULL);
2703 }
26792704
26802705 done:
26812706 if (subs) mboxlist_closesubs(subs);
27192744 char domainpat[MAX_MAILBOX_BUFFER]; /* do intra-domain fetches only */
27202745 char *pat = NULL;
27212746
2747 if (!namespace) namespace = mboxname_get_adminnamespace();
2748
27222749 if (config_virtdomains && userid && (p = strchr(userid, '@'))) {
27232750 userlen = p - userid;
27242751 domainlen = strlen(p); /* includes separator */
28262853 *
28272854 * If "Other Users*" can match pattern, search for those subscriptions next
28282855 */
2829 len = strlen(namespace->prefix[NAMESPACE_USER]);
2830 if (len>0) len--; /* Remove Separator */
2831 if (!strncmp(namespace->prefix[NAMESPACE_USER], pattern,
2832 prefixlen < len ? prefixlen : len)) {
2833
2834 if (prefixlen < len) {
2835 strlcpy(domainpat+domainlen, pattern+prefixlen,
2836 sizeof(domainpat)-domainlen);
2837 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2838 }
2839 else {
2840 strlcpy(domainpat+domainlen, "user",
2841 sizeof(domainpat)-domainlen);
2842 strlcat(domainpat, pattern+len, sizeof(domainpat));
2843 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2844 }
2845 cbrock.find_namespace = NAMESPACE_USER;
2846 cbrock.inboxoffset = 0;
2847
2848 /* iterate through prefixes matching usermboxname */
2849 strlcpy(domainpat+domainlen, "user", sizeof(domainpat)-domainlen);
2850 SUBDB->foreach(subs,
2851 domainpat, strlen(domainpat),
2852 &find_p, &find_cb, &cbrock,
2853 NULL);
2854
2855 glob_free(&cbrock.g);
2856
2857 if (isadmin || namespace->accessible[NAMESPACE_USER]) {
2858 len = strlen(namespace->prefix[NAMESPACE_USER]);
2859 if(len>0) len--; /* Remove Separator */
2860 if (!strncmp(namespace->prefix[NAMESPACE_USER], pattern,
2861 prefixlen < len ? prefixlen : len)) {
2862
2863 if (prefixlen < len) {
2864 strlcpy(domainpat+domainlen, pattern+prefixlen,
2865 sizeof(domainpat)-domainlen);
2866 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2867 }
2868 else {
2869 strlcpy(domainpat+domainlen, "user",
2870 sizeof(domainpat)-domainlen);
2871 strlcat(domainpat, pattern+len, sizeof(domainpat));
2872 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2873 }
2874 cbrock.find_namespace = NAMESPACE_USER;
2875 cbrock.inboxoffset = 0;
2876
2877 /* iterate through prefixes matching usermboxname */
2878 strlcpy(domainpat+domainlen, "user", sizeof(domainpat)-domainlen);
2879 SUBDB->foreach(subs,
2880 domainpat, strlen(domainpat),
2881 &find_p, &find_cb, &cbrock,
2882 NULL);
2883
2884 glob_free(&cbrock.g);
2885 }
28562886 }
28572887
28582888 /*
28612891 * search for all remaining subscriptions.
28622892 * just bother looking at the ones that have the same pattern prefix.
28632893 */
2864 len = strlen(namespace->prefix[NAMESPACE_SHARED]);
2865 if(len>0) len--; /* Remove Separator */
2866 if (!strncmp(namespace->prefix[NAMESPACE_SHARED], pattern,
2867 prefixlen < len ? prefixlen : len)) {
2868
2869 cbrock.find_namespace = NAMESPACE_SHARED;
2870 cbrock.inboxoffset = 0;
2871
2872 if (prefixlen <= len) {
2873 /* Skip pattern which matches shared namespace prefix */
2874 for (p = pat+prefixlen; *p; p++) {
2875 if (*p == '%') continue;
2876 else if (*p == '.') p++;
2877 break;
2878 }
2879
2880 if (*pattern && !strchr(pattern, '.') &&
2881 pattern[strlen(pattern)-1] == '%') {
2882 /* special case: LSUB "" *% -- output prefix */
2883 cbrock.checkshared = 1;
2884 }
2885
2886 if ((cbrock.checkshared || prefixlen == len) && !*p) {
2887 /* special case: LSUB "" % -- output prefix
2888 (if we have a shared mbox) and quit */
2889 strlcpy(domainpat+domainlen, "*", sizeof(domainpat)-domainlen);
2894 if (isadmin || namespace->accessible[NAMESPACE_SHARED]) {
2895 len = strlen(namespace->prefix[NAMESPACE_SHARED]);
2896 if(len>0) len--; /* Remove Separator */
2897 if (!strncmp(namespace->prefix[NAMESPACE_SHARED], pattern,
2898 prefixlen < len ? prefixlen : len)) {
2899
2900 cbrock.find_namespace = NAMESPACE_SHARED;
2901 cbrock.inboxoffset = 0;
2902
2903 if (prefixlen <= len) {
2904 /* Skip pattern which matches shared namespace prefix */
2905 for (p = pat+prefixlen; *p; p++) {
2906 if (*p == '%') continue;
2907 else if (*p == '.') p++;
2908 break;
2909 }
2910
2911 if (*pattern && !strchr(pattern, '.') &&
2912 pattern[strlen(pattern)-1] == '%') {
2913 /* special case: LSUB "" *% -- output prefix */
2914 cbrock.checkshared = 1;
2915 }
2916
2917 if ((cbrock.checkshared || prefixlen == len) && !*p) {
2918 /* special case: LSUB "" % -- output prefix
2919 (if we have a shared mbox) and quit */
2920 strlcpy(domainpat+domainlen, "*", sizeof(domainpat)-domainlen);
2921 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2922 cbrock.checkshared = 2;
2923 }
2924 else {
2925 strlcpy(domainpat+domainlen, p, sizeof(domainpat)-domainlen);
2926 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2927 }
2928
2929 domainpat[domainlen] = '\0';
2930 SUBDB->foreach(subs,
2931 domainpat, domainlen,
2932 &find_p, &find_cb, &cbrock,
2933 NULL);
2934 }
2935 else if (pattern[len] == '.') {
2936 strlcpy(domainpat+domainlen, pattern+len+1,
2937 sizeof(domainpat)-domainlen);
28902938 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2891 cbrock.checkshared = 2;
2892 }
2893 else {
2894 strlcpy(domainpat+domainlen, p, sizeof(domainpat)-domainlen);
2895 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2896 }
2897
2898 domainpat[domainlen] = '\0';
2899 SUBDB->foreach(subs,
2900 domainpat, domainlen,
2901 &find_p, &find_cb, &cbrock,
2902 NULL);
2903 }
2904 else if (pattern[len] == '.') {
2905 strlcpy(domainpat+domainlen, pattern+len+1,
2906 sizeof(domainpat)-domainlen);
2907 cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
2908
2909 SUBDB->foreach(subs,
2910 domainpat, domainlen+prefixlen-(len+1),
2911 &find_p, &find_cb, &cbrock,
2912 NULL);
2939
2940 SUBDB->foreach(subs,
2941 domainpat, domainlen+prefixlen-(len+1),
2942 &find_p, &find_cb, &cbrock,
2943 NULL);
2944 }
29132945 }
29142946 }
29152947
161161
162162 /* direct access to subs DB */
163163 int mboxlist_allsubs(const char *userid, foreach_cb *proc, void *rock);
164 int mboxlist_allmbox(const char *prefix, foreach_cb *proc, void *rock);
164165
165166 /* Find subscribed mailboxes that match 'pattern'. */
166167 int mboxlist_findsub(struct namespace *namespace,
7272
7373 static struct mboxlocklist *open_mboxlocks = NULL;
7474
75 static struct namespace *admin_namespace;
76
7577 /* Mailbox patterns which the design of the server prohibits */
7678 static char *badmboxpatterns[] = {
7779 "",
643645 config_getswitch(IMAPOPT_UNIXHIERARCHYSEP) ? '/' : '.';
644646 namespace->isalt = !isadmin && config_getswitch(IMAPOPT_ALTNAMESPACE);
645647
648 namespace->accessible[NAMESPACE_INBOX] = 1;
649 namespace->accessible[NAMESPACE_USER] = !config_getswitch(IMAPOPT_DISABLE_USER_NAMESPACE);
650 namespace->accessible[NAMESPACE_SHARED] = !config_getswitch(IMAPOPT_DISABLE_SHARED_NAMESPACE);
651
646652 if (namespace->isalt) {
647653 /* alternate namespace */
648654 strcpy(namespace->prefix[NAMESPACE_INBOX], "");
687693 return 0;
688694 }
689695
696 struct namespace *mboxname_get_adminnamespace()
697 {
698 static struct namespace ns;
699 if (!admin_namespace) {
700 mboxname_init_namespace(&ns, /*isadmin*/1);
701 admin_namespace = &ns;
702 }
703 return admin_namespace;
704 }
705
690706 /*
691707 * Translate separator charactors in a mailboxname from its external
692708 * representation to its internal representation '.'.
744760 */
745761 int mboxname_userownsmailbox(const char *userid, const char *name)
746762 {
747 struct namespace internal = { '.', 0, 0, { "INBOX.", "user.", "" },
748 NULL, NULL, NULL, NULL };
763 struct namespace internal = NAMESPACE_INITIALIZER;
749764 char inboxname[MAX_MAILBOX_BUFFER];
750765
751766 if (!mboxname_tointernal(&internal, "INBOX", userid, inboxname) &&
9931008 }
9941009 return 0;
9951010 }
1011
1012 int mboxname_is_prefix(const char *longstr, const char *shortstr)
1013 {
1014 int longlen = strlen(longstr);
1015 int shortlen = strlen(shortstr);
1016
1017 /* can't be a child */
1018 if (longlen < shortlen)
1019 return 0;
1020
1021 /* don't match along same length */
1022 if (strncmp(longstr, shortstr, shortlen))
1023 return 0;
1024
1025 /* longer, and not a separator */
1026 if (longlen > shortlen && longstr[shortlen] != '.')
1027 return 0;
1028
1029 /* it's a match! */
1030 return 1;
1031 }
1032
9961033
9971034 void mboxname_hash(char *buf, size_t buf_len,
9981035 const char *root,
6262 int isalt; /* are we using the alternate namespace? */
6363 int isadmin; /* current user is an admin */
6464 char prefix[3][MAX_NAMESPACE_PREFIX+1];
65 int accessible[3];
6566 /* Convert the external mailbox 'name' to an internal name. */
6667 int (*mboxname_tointernal)(struct namespace *namespace, const char *name,
6768 const char *userid, char *result);
7879 void *rock, int force);
7980 };
8081
82 #define NAMESPACE_INITIALIZER { '.', 0, 0, \
83 { "INBOX.", "user.", "" }, \
84 { 0, 0, 0, }, \
85 NULL, NULL, NULL, NULL }
86
8187 struct mboxlock {
8288 char *name;
8389 int lock_fd;
9096
9197 /* Create namespace based on config options. */
9298 int mboxname_init_namespace(struct namespace *namespace, int isadmin);
99
100 struct namespace *mboxname_get_adminnamespace();
93101
94102 /*
95103 * Translate separator charactors in a mailboxname from its external
123131 * returns boolean
124132 */
125133 int mboxname_isdeletedmailbox(const char *name);
134
135 /* check if one mboxname is a parent or same as the other */
136 int mboxname_is_prefix(const char *longstr, const char *shortstr);
126137
127138 /*
128139 * Translate (internal) inboxname into corresponding userid.
18161816 struct param *boundary;
18171817 char *defaultContentType = DEFAULT_CONTENT_TYPE;
18181818 int i, depth;
1819 int limit = config_getint(IMAPOPT_BOUNDARY_LIMIT);
18191820
18201821 memset(&preamble, 0, sizeof(struct body));
18211822 memset(&epilogue, 0, sizeof(struct body));
18501851 message_parse_content(msg, &preamble, boundaries);
18511852
18521853 /* Parse the component body-parts */
1853 while (boundaries->count == depth) {
1854 while (boundaries->count == depth &&
1855 (limit == 0 ? 1 : boundaries->count < limit)) {
18541856 body->subpart = (struct body *)xrealloc((char *)body->subpart,
18551857 (body->numparts+1)*sizeof(struct body));
18561858 message_parse_body(msg, &body->subpart[body->numparts++],
19111913 */
19121914 body->boundary_size += epilogue.boundary_size;
19131915 body->boundary_lines += epilogue.boundary_lines;
1916
1917 /* check if we've hit a limit and flag it */
1918 if (limit && depth == limit) {
1919 syslog(LOG_ERR, "ERROR: mime boundary limit %i exceeded, not parsing anymore", limit);
1920 }
19141921 }
19151922
19161923 /*
28732873
28742874 char **rcpt; /* mailboxes to post message */
28752875 int rcpt_num; /* number of groups */
2876 char *date; /* date field of header */
28762877
28772878 hdrcache_t hdrcache;
28782879 };
28902891 ret->size = 0;
28912892 ret->rcpt = NULL;
28922893 ret->rcpt_num = 0;
2894 ret->date = NULL;
28932895
28942896 ret->hdrcache = spool_new_hdrcache();
28952897
29222924 free(m->rcpt[i]);
29232925 }
29242926 free(m->rcpt);
2927 }
2928 if (m->date) {
2929 free(m->date);
29252930 }
29262931
29272932 spool_free_hdrcache(m->hdrcache);
30463051 char datestr[80];
30473052
30483053 rfc822date_gen(datestr, sizeof(datestr), now);
3054 m->date = xstrdup(datestr);
30493055 fprintf(f, "Date: %s\r\n", datestr);
30503056 spool_cache_header(xstrdup("Date"), xstrdup(datestr), m->hdrcache);
3057 }
3058 else {
3059 m->date = xstrdup(body[0]);
30513060 }
30523061
30533062 /* get control */
32783287 unsigned long uid;
32793288 struct body *body = NULL;
32803289 struct dest *dlist = NULL;
3290 duplicate_key_t dkey = {msg->id, NULL, msg->date};
32813291
32823292 /* check ACLs of all mailboxes */
32833293 for (n = 0; n < msg->rcpt_num; n++) {
32853295
32863296 /* look it up */
32873297 r = mlookup(rcpt, &server, &acl, NULL);
3298 dkey.to = rcpt;
32883299 if (r) return IMAP_MAILBOX_NONEXISTENT;
32893300
32903301 if (!(acl && (myrights = cyrus_acl_myrights(nntp_authstate, acl)) &&
33003311 struct appendstate as;
33013312
33023313 if (msg->id &&
3303 duplicate_check(msg->id, strlen(msg->id), rcpt, strlen(rcpt))) {
3314 duplicate_check(&dkey)) {
33043315 /* duplicate message */
3305 duplicate_log(msg->id, rcpt, "nntp delivery");
3316 duplicate_log(&dkey, "nntp delivery");
33063317 continue;
33073318 }
33083319
33183329 r = append_fromstream(&as, &body, msg->data, msg->size, 0,
33193330 (const char **) NULL, 0);
33203331 }
3321 if (r || (msg->id &&
3322 duplicate_check(msg->id, strlen(msg->id),
3323 rcpt, strlen(rcpt)))) {
3332 if (r || ( msg->id && duplicate_check(&dkey) ) ) {
33243333 append_abort(&as);
33253334
33263335 if (!r) {
33273336 /* duplicate message */
3328 duplicate_log(msg->id, rcpt, "nntp delivery");
3337 duplicate_log(&dkey, "nntp delivery");
33293338 continue;
33303339 }
33313340 }
33353344 }
33363345
33373346 if (!r && msg->id)
3338 duplicate_mark(msg->id, strlen(msg->id), rcpt, strlen(rcpt),
3339 time(NULL), uid);
3347 duplicate_mark(&dkey, time(NULL), uid);
33403348
33413349 if (r) return r;
33423350
35083516 /* store msgid of cancelled message for IHAVE/CHECK/TAKETHIS
35093517 * (in case we haven't received the message yet)
35103518 */
3511 duplicate_mark(msgid, strlen(msgid), "", 0, 0, time(NULL));
3519 duplicate_key_t dkey = {msgid, "", ""};
3520 duplicate_mark(&dkey, 0, time(NULL));
35123521
35133522 return r;
35143523 }
41544163 else if (*c == '@') wild[n].not = -1; /* absolute not (feeding) */
41554164 else wild[n].not = 0;
41564165
4157 strcpy(p, wild[n].not ? c + 1 : c);
4166 strncpy(p, wild[n].not ? c + 1 : c, pattern+sizeof(pattern) - p);
4167 pattern[sizeof(pattern)-1] = '\0';
4168
41584169 wild[n++].pat = xstrdup(pattern);
41594170 } while (c != str);
41604171 wild[n].pat = NULL;
7474 #endif
7575
7676 #include "assert.h"
77 #include "bsearch.h"
7778 #include "cyrusdb.h"
7879 #include "global.h"
7980 #include "exitcodes.h"
9798 /* config.c stuff */
9899 const int config_need_data = CONFIG_NEED_PARTITION_DATA;
99100
100 struct fix_rock {
101 char *domain;
102 struct txn **tid;
103 unsigned long change_count;
104 };
105
106101 struct quotaentry {
107102 struct quota quota;
108103 char *allocname;
114109 /* forward declarations */
115110 void usage(void);
116111 void reportquota(void);
117 int buildquotalist(char *domain, char **roots, int nroots,
118 struct fix_rock *frock);
119 int fixquota_mailbox(char *name, int matchlen, int maycreate, void *rock);
120 int fixquota(struct fix_rock *frock);
121 int fixquota_fixroot(struct mailbox *mailbox, const char *root);
122 int fixquota_finish(int thisquota, struct txn **tid, unsigned long *count);
112 static int buildquotalist(char *domain, char **roots, int nroots);
113 static int fixquotas(char *domain, char **roots, int nroots);
114 static int fixquota_mailbox(void *rock, const char *name, int namelen,
115 const char *val, int vallen);
116 static int fixquota_fixroot(struct mailbox *mailbox, const char *root);
117 static int fixquota_finish(int thisquota);
118 static int (*compar)(const char *s1, const char *s2);
123119
124120 #define QUOTAGROW 300
125121
128124
129125 int firstquota = 0;
130126 int redofix = 0;
131 int partial;
132127
133128 int main(int argc,char **argv)
134129 {
135130 int opt;
131 int i;
136132 int fflag = 0;
137133 int r, code = 0;
138134 char *alt_config = NULL, *domain = NULL;
139 struct fix_rock frock;
140 struct txn *tid = NULL;
141135
142136 if ((geteuid()) == 0 && (become_cyrus() != 0)) {
143137 fatal("must run as the Cyrus user", EC_USAGE);
169163 syslog(LOG_ERR, "%s", error_message(r));
170164 fatal(error_message(r), EC_CONFIG);
171165 }
166
167 if (config_getswitch(IMAPOPT_IMPROVED_MBOXLIST_SORT))
168 compar = bsearch_compare;
169 else
170 compar = strcmp;
172171
173172 /*
174173 * Lock mailbox list to prevent mailbox creation/deletion
180179 quotadb_init(0);
181180 quotadb_open(NULL);
182181
183 if (!r) {
184 frock.domain = domain;
185 frock.tid = &tid;
186 frock.change_count = 0;
187
188 r = buildquotalist(domain, argv+optind, argc-optind,
189 fflag ? &frock : NULL);
190 }
191
192 if (!r && fflag) {
193 partial = argc-optind;
194 r = fixquota(&frock);
195 }
182 r = buildquotalist(domain, argv+optind, argc-optind);
183
184 if (!r && fflag)
185 r = fixquotas(domain, argv+optind, argc-optind);
196186
197187 quotadb_close();
198188 quotadb_done();
202192
203193 if (r) code = convert_code(r);
204194 else reportquota();
195
196 /* just for neatness */
197 for (i = 0; i < quota_num; i++)
198 free(quota[i].allocname);
199 free(quota);
205200
206201 cyrus_done();
207202
213208 fprintf(stderr,
214209 "usage: quota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n");
215210 exit(EC_USAGE);
216 }
211 }
217212
218213 void errmsg(const char *fmt, const char *arg, int err)
219214 {
231226 }
232227
233228 /*
234 * A matching mailbox was found, process it.
235 */
236 static int found_match(char *name, int matchlen, int maycreate, void *frock)
237 {
238 int r;
239
229 * A quotaroot was found, add it to our list
230 */
231 static int fixquota_addroot(struct quota *q,
232 void *rock __attribute__((unused)))
233 {
240234 if (quota_num == quota_alloc) {
241235 /* Create new qr list entry */
242236 quota_alloc += QUOTAGROW;
245239 memset(&quota[quota_num], 0, QUOTAGROW * sizeof(struct quotaentry));
246240 }
247241
248 /* See if the mailbox name corresponds to a quotaroot */
249 quota[quota_num].quota.root = name;
250 do {
251 r = quota_read(&quota[quota_num].quota, NULL, 0);
252 } while (r == IMAP_AGAIN);
253
254 switch (r) {
255 case 0:
256 /* Its a quotaroot! */
257 quota[quota_num].allocname = xstrdup(name);
258 quota[quota_num].quota.root = quota[quota_num].allocname;
259 quota_num++;
260 break;
261 case IMAP_QUOTAROOT_NONEXISTENT:
262 if (!frock || !quota_num ||
263 strncmp(name, quota[quota_num-1].quota.root,
264 strlen(quota[quota_num-1].quota.root))) {
265 /* Its not a quotaroot, and either we're not fixing quotas,
266 or its not part of the most recent quotaroot */
267 return 0;
268 }
269 break;
270 default:
271 return r;
272 }
273
274 if (frock) {
275 /* Recalculate the quota (we need the subfolders too!) */
276 r = fixquota_mailbox(name, matchlen, maycreate, frock);
277 }
278
279 return r;
242 /* copy this quota */
243 quota[quota_num].allocname = xstrdup(q->root);
244 quota[quota_num].quota.root = quota[quota_num].allocname;
245 quota[quota_num].quota.limit = q->limit;
246 quota[quota_num].quota.used = q->used;
247 quota_num++;
248
249 return 0;
280250 }
281251
282252 /*
283253 * Build the list of quota roots in 'quota'
284254 */
285 int buildquotalist(char *domain, char **roots, int nroots,
286 struct fix_rock *frock)
255 int buildquotalist(char *domain, char **roots, int nroots)
287256 {
288257 int i, r;
289258 char buf[MAX_MAILBOX_BUFFER], *tail;
296265 tail += domainlen;
297266 }
298267
268 /* basic case - everything (potentially limited by domain still) */
269 if (!nroots) {
270 r = quota_foreach(buf, fixquota_addroot, NULL);
271 if (r) {
272 errmsg("failed building quota list for '%s'", buf, IMAP_IOERROR);
273 }
274 }
275
299276 /*
300 * Walk through all given pattern(s) and resolve them to all
301 * matching mailbox names. Call found_match() for every mailbox
302 * name found. If no pattern is given, assume "*".
277 * Walk through all given pattern(s) and add all the quota roots
278 * with the matching prefixes.
303279 */
304 i = 0;
305 do {
306 if (nroots > 0) {
307 /* Translate separator in quotaroot.
308 *
309 * We do this directly instead of using the mboxname_tointernal()
310 * function pointer because we know that we are using the internal
311 * namespace and so we don't have to allocate a buffer for the
312 * translated name.
313 */
314 mboxname_hiersep_tointernal(&quota_namespace, roots[i], 0);
315
316 strlcpy(tail, roots[i], sizeof(buf) - domainlen);
280 for (i = 0; i < nroots; i++) {
281 strlcpy(tail, roots[i], sizeof(buf) - domainlen);
282 /* change the separator to internal namespace */
283 mboxname_hiersep_tointernal(&quota_namespace, tail, 0);
284
285 r = quota_foreach(buf, fixquota_addroot, NULL);
286 if (r) {
287 errmsg("failed building quota list for '%s'", buf, IMAP_IOERROR);
288 break;
289 }
290 }
291
292 return r;
293 }
294
295 static int findroot(const char *name, int *thisquota)
296 {
297 int i;
298
299 *thisquota = -1;
300
301 for (i = firstquota; i < quota_num; i++) {
302 const char *root = quota[i].quota.root;
303
304 /* have we already passed the name, then there can
305 * be no further matches */
306 if (compar(root, name) > 0)
307 return 0;
308
309 /* is the mailbox within this root? */
310 if (mboxname_is_prefix(name, root)) {
311 /* fantastic, but don't return yet, we may find
312 * a more exact match */
313 quota[i].refcount++;
314 *thisquota = i;
317315 }
318316 else {
319 strlcpy(tail, "*", sizeof(buf) - domainlen);
320 }
321 i++;
322
323 r = (*quota_namespace.mboxlist_findall)(&quota_namespace, buf, 1, 0, 0,
324 &found_match, frock);
325 if (r < 0) {
326 errmsg("failed building quota list for '%s'", buf, IMAP_IOERROR);
327 return IMAP_IOERROR;
328 }
329
330 } while (i < nroots);
317 /* not a match, so we can finish everything up to here */
318 while (firstquota < i) {
319 int r = fixquota_finish(firstquota);
320 if (r) return r;
321 firstquota++;
322 }
323 }
324 }
331325
332326 return 0;
333327 }
335329 /*
336330 * Account for mailbox 'name' when fixing the quota roots
337331 */
338 int fixquota_mailbox(char *name,
339 int matchlen __attribute__((unused)),
340 int maycreate __attribute__((unused)),
341 void *rock)
342 {
343 int r;
332 static int fixquota_mailbox(void *rock __attribute__((unused)),
333 const char *name, int namelen,
334 const char *val __attribute__((unused)),
335 int vallen __attribute__((unused)))
336 {
337 int r = 0;
344338 struct mailbox *mailbox = NULL;
345 int i, len, thisquota, thisquotalen;
346 struct fix_rock *frock = (struct fix_rock *) rock;
347 char *p, *domain = frock->domain;
348
349 /* make sure the domains match */
350 if (domain &&
351 (!(p = strchr(name, '!')) || (p - name) != (int) strlen(domain) ||
352 strncmp(name, domain, p - name))) {
353 return 0;
354 }
355
356 while (firstquota < quota_num &&
357 strncmp(name, quota[firstquota].quota.root,
358 strlen(quota[firstquota].quota.root)) > 0) {
359 r = fixquota_finish(firstquota++, frock->tid, &frock->change_count);
360 if (r) return r;
361 }
362
363 thisquota = -1;
364 thisquotalen = 0;
365 for (i = firstquota;
366 i < quota_num && strcmp(name, quota[i].quota.root) >= 0; i++) {
367 len = strlen(quota[i].quota.root);
368 if (!strncmp(name, quota[i].quota.root, len) &&
369 (!name[len] || name[len] == '.' ||
370 (domain && name[len-1] == '!'))) {
371 quota[i].refcount++;
372 if (len > thisquotalen) {
373 thisquota = i;
374 thisquotalen = len;
375 }
376 }
377 }
378
379 if (partial && thisquota == -1) return 0;
380
381 r = mailbox_open_iwl(name, &mailbox);
382 if (r) errmsg("failed opening header for mailbox '%s'", name, r);
339 int thisquota = -1;
340 char *mboxname = xstrndup(name, namelen);
341
342 r = findroot(mboxname, &thisquota);
343 if (r) {
344 errmsg("failed finding quotaroot for mailbox '%s'", name, r);
345 goto done;
346 }
347
348 r = mailbox_open_iwl(mboxname, &mailbox);
349 if (r) {
350 errmsg("failed opening header for mailbox '%s'", name, r);
351 goto done;
352 }
353
354 if (thisquota == -1) {
355 /* no matching quotaroot exists, remove from
356 * mailbox if present */
357 if (mailbox->quotaroot) {
358 r = fixquota_fixroot(mailbox, (char *)0);
359 }
360 }
383361 else {
384 if (thisquota == -1) {
385 if (mailbox->quotaroot) {
386 r = fixquota_fixroot(mailbox, (char *)0);
387 }
388 }
389 else {
390 if (!mailbox->quotaroot ||
391 strcmp(mailbox->quotaroot, quota[thisquota].quota.root) != 0) {
392 r = fixquota_fixroot(mailbox, quota[thisquota].quota.root);
393 }
394
395 if (!r) quota[thisquota].newused += mailbox->i.quota_mailbox_used;
396 }
397
398 mailbox_close(&mailbox);
399 }
400
401 if (r) {
402 /* mailbox error of some type, commit what we have */
403 quota_commit(frock->tid);
404 *(frock->tid) = NULL;
405 }
362 /* matching quotaroot exists, ensure mailbox has the
363 * correct root */
364 if (!mailbox->quotaroot ||
365 strcmp(mailbox->quotaroot, quota[thisquota].quota.root) != 0) {
366 r = fixquota_fixroot(mailbox, quota[thisquota].quota.root);
367 }
368
369 /* and track the total usage inside this root */
370 if (!r)
371 quota[thisquota].newused += mailbox->i.quota_mailbox_used;
372 }
373
374 done:
375 mailbox_close(&mailbox);
376 free(mboxname);
406377
407378 return r;
408379 }
411382 const char *root)
412383 {
413384 int r;
414
415 redofix = 1;
416385
417386 printf("%s: quota root %s --> %s\n", mailbox->name,
418387 mailbox->quotaroot ? mailbox->quotaroot : "(none)",
427396 /*
428397 * Finish fixing up a quota root
429398 */
430 int fixquota_finish(int thisquota, struct txn **tid, unsigned long *count)
399 int fixquota_finish(int thisquota)
431400 {
432401 int r = 0;
402 struct txn *tid = NULL;
433403
434404 if (!quota[thisquota].refcount) {
435 if (!quota[thisquota].deleted++) {
436 printf("%s: removed\n", quota[thisquota].quota.root);
437 r = quota_deleteroot(quota[thisquota].quota.root);
438 if (r) {
439 errmsg("failed deleting quotaroot '%s'",
440 quota[thisquota].quota.root, r);
441 return r;
442 }
443 (*count)++;
444 }
405 printf("%s: removed\n", quota[thisquota].quota.root);
406 r = quota_deleteroot(quota[thisquota].quota.root);
407 if (r) {
408 errmsg("failed deleting quotaroot '%s'",
409 quota[thisquota].quota.root, r);
410 }
411 return r;
412 }
413
414 /* nothing changed, all good */
415 if (quota[thisquota].quota.used == quota[thisquota].newused)
445416 return 0;
446 }
447
448 if (quota[thisquota].quota.used != quota[thisquota].newused) {
449 /* re-read the quota with the record locked */
450 r = quota_read(&quota[thisquota].quota, tid, 1);
451 if (r) {
452 errmsg("failed reading quotaroot '%s'",
453 quota[thisquota].quota.root, r);
454 return r;
455 }
456 (*count)++;
457 }
417
418 /* re-read the quota with the record locked */
419 r = quota_read(&quota[thisquota].quota, &tid, 1);
420 if (r) {
421 errmsg("failed reading quotaroot '%s'",
422 quota[thisquota].quota.root, r);
423 return r;
424 }
425
426 /* is it still different? */
458427 if (quota[thisquota].quota.used != quota[thisquota].newused) {
459428 printf("%s: usage was " UQUOTA_T_FMT ", now " UQUOTA_T_FMT "\n",
460429 quota[thisquota].quota.root,
461430 quota[thisquota].quota.used, quota[thisquota].newused);
462431 quota[thisquota].quota.used = quota[thisquota].newused;
463 r = quota_write(&quota[thisquota].quota, tid);
432 r = quota_write(&quota[thisquota].quota, &tid);
464433 if (r) {
465434 errmsg("failed writing quotaroot '%s'",
466435 quota[thisquota].quota.root, r);
436 quota_abort(&tid);
467437 return r;
468438 }
469 (*count)++;
470 }
471
472 /* commit the transaction every 100 changes */
473 if (*count && !(*count % 100)) {
474 quota_commit(tid);
475 *tid = NULL;
476 }
477
478 return r;
479 }
480
439 }
440
441 quota_commit(&tid);
442
443 return 0;
444 }
481445
482446 /*
483447 * Fix all the quota roots
484448 */
485 int fixquota(struct fix_rock *frock)
486 {
487 int i, r = 0;
488
489 while (!r && redofix) {
490 while (!r && firstquota < quota_num) {
491 r = fixquota_finish(firstquota++, frock->tid, &frock->change_count);
492 }
493
494 redofix = 0;
495 firstquota = 0;
496
497 /*
498 * Loop over all qr entries and recalculate the quota.
499 * We need the subfolders too!
500 */
501 for (i = 0; !r && i < quota_num; i++) {
502 r = (*quota_namespace.mboxlist_findall)(&quota_namespace,
503 quota[i].quota.root,
504 1, 0, 0, fixquota_mailbox,
505 frock);
449 int fixquotas(char *domain, char **roots, int nroots)
450 {
451 int i, r;
452 char buf[MAX_MAILBOX_BUFFER], *tail;
453 size_t domainlen = 0;
454
455 buf[0] = '\0';
456 tail = buf;
457 if (domain) {
458 domainlen = snprintf(buf, sizeof(buf), "%s!", domain);
459 tail += domainlen;
460 }
461
462 /* basic case - everything (potentially limited by domain still) */
463 if (!nroots) {
464 r = mboxlist_allmbox(buf, fixquota_mailbox, NULL);
465 if (r) {
466 errmsg("processing mbox list for '%s'", buf, IMAP_IOERROR);
467 }
468 }
469
470 /*
471 * Walk through all given pattern(s) and add all the quota roots
472 * with the matching prefixes.
473 */
474 for (i = 0; i < nroots; i++) {
475 strlcpy(tail, roots[i], sizeof(buf) - domainlen);
476 /* change the separator to internal namespace */
477 mboxname_hiersep_tointernal(&quota_namespace, tail, 0);
478
479 r = mboxlist_allmbox(buf, fixquota_mailbox, NULL);
480 if (r) {
481 errmsg("processing mbox list for '%s'", buf, IMAP_IOERROR);
482 break;
506483 }
507484 }
508485
509486 while (!r && firstquota < quota_num) {
510 r = fixquota_finish(firstquota++, frock->tid, &frock->change_count);
511 }
512
513 if (!r && *(frock->tid)) quota_commit(frock->tid);
514
515 return 0;
516 }
517
487 r = fixquota_finish(firstquota);
488 firstquota++;
489 }
490
491 return r;
492 }
493
518494 /*
519495 * Print out the quota report
520496 */
7979 int limit; /* in QUOTA_UNITS */
8080 };
8181
82 typedef int quotaproc_t(struct quota *quota, void *rock);
83
8284 extern void quota_setroot(struct quota *quota, const char *root);
8385
8486 extern int quota_read(struct quota *quota, struct txn **tid, int wrlock);
9294 extern int quota_deleteroot(const char *quotaroot);
9395
9496 extern int quota_findroot(char *ret, size_t retlen, const char *name);
97
98 extern int quota_foreach(const char *prefix, quotaproc_t *proc, void *rock);
9599
96100 extern void quota_free(struct quota *quota);
97101
7070
7171 static int quota_dbopen = 0;
7272
73 static int quota_parseval(const char *data, struct quota *quota)
74 {
75 if (sscanf(data, UQUOTA_T_FMT " %d",
76 &quota->used, &quota->limit) != 2)
77 return 0;
78 return 1;
79 }
80
7381 /*
7482 * Read the quota entry 'quota'
7583 */
93101
94102 switch (r) {
95103 case CYRUSDB_OK:
96 if (!*data)
97 return IMAP_QUOTAROOT_NONEXISTENT;
98 else if (sscanf(data, UQUOTA_T_FMT " %d",
99 &quota->used, &quota->limit) != 2) {
104 if (!*data) return IMAP_QUOTAROOT_NONEXISTENT;
105 if (!quota_parseval(data, quota)) {
100106 syslog(LOG_ERR, "DBERROR: error fetching quota "
101 "root=<%s> value=<%s> error=<%s>",
102 quota->root, data, cyrusdb_strerror(r));
107 "root=<%s> value=<%s>",
108 quota->root, data);
103109 return CYRUSDB_IOERROR;
104110 }
105111 break;
120126 }
121127
122128 return 0;
129 }
130
131 struct quota_foreach_t {
132 quotaproc_t *proc;
133 void *rock;
134 };
135
136 static int do_onequota(void *rock,
137 const char *key, int keylen,
138 const char *data, int datalen)
139 {
140 int r = 0;
141 struct quota quota;
142 struct quota_foreach_t *fd = (struct quota_foreach_t *)rock;
143 char *root = xstrndup(key, keylen);
144
145 quota.root = root;
146
147 /* XXX - error if not parsable? */
148 if (datalen && quota_parseval(data, &quota)) {
149 r = fd->proc(&quota, fd->rock);
150 }
151
152 free(root);
153
154 return r;
155 }
156
157 int quota_foreach(const char *prefix, quotaproc_t *proc, void *rock)
158 {
159 int r;
160 char *search = prefix ? (char *)prefix : "";
161 struct quota_foreach_t foreach_d;
162
163 foreach_d.proc = proc;
164 foreach_d.rock = rock;
165
166 r = QDB->foreach(qdb, search, strlen(search), NULL,
167 do_onequota, &foreach_d, NULL);
168
169 return r;
123170 }
124171
125172 /*
226273 return (QDB->fetch(qdb, ret, strlen(ret), NULL, NULL, NULL) == 0);
227274 }
228275
229
230276 /* must be called after cyrus_init */
231277 void quotadb_init(int myflags)
232278 {
241287 {
242288 int ret;
243289 char *tofree = NULL;
290 int flags = CYRUSDB_CREATE;
244291
245292 if (!fname)
246293 fname = config_getstring(IMAPOPT_QUOTA_DB_PATH);
251298 fname = tofree;
252299 }
253300
254 ret = (QDB->open)(fname, CYRUSDB_CREATE, &qdb);
301 if (config_getswitch(IMAPOPT_IMPROVED_MBOXLIST_SORT))
302 flags |= CYRUSDB_MBOXSORT;
303
304 ret = (QDB->open)(fname, flags, &qdb);
255305 if (ret != 0) {
256306 syslog(LOG_ERR, "DBERROR: opening %s: %s", fname,
257307 cyrusdb_strerror(ret));
545545 return SQUAT_OK;
546546
547547 cleanup_fd:
548 close(b->fd);
548 close(fd);
549549 return SQUAT_ERR;
550550 }
551551
699699 static int copy_local(struct mailbox *mailbox, unsigned long uid)
700700 {
701701 uint32_t recno;
702 struct index_record record;
703 char *oldfname, *newfname;
702 struct index_record oldrecord;
704703 int r;
705704
706705 for (recno = 1; recno <= mailbox->i.num_records; recno++) {
707 r = mailbox_read_index_record(mailbox, recno, &record);
706 r = mailbox_read_index_record(mailbox, recno, &oldrecord);
708707 if (r) return r;
709 if (record.uid == uid) {
710 /* store the old record, expunged */
711 record.system_flags |= FLAG_EXPUNGED;
712 r = mailbox_rewrite_index_record(mailbox, &record);
713 if (r) return r;
714
715 /* create the new record */
716 record.system_flags &= ~FLAG_EXPUNGED;
717 record.uid = mailbox->i.last_uid + 1;
708
709 /* found the record, renumber it */
710 if (oldrecord.uid == uid) {
711 char *oldfname, *newfname;
712 struct index_record newrecord;
713
714 /* create the new record as a clone of the old record */
715 newrecord = oldrecord;
716 newrecord.uid = mailbox->i.last_uid + 1;
718717
719718 /* copy the file in to place */
720 oldfname = xstrdup(mailbox_message_fname(mailbox, uid));
721 newfname = xstrdup(mailbox_message_fname(mailbox, record.uid));
719 oldfname = xstrdup(mailbox_message_fname(mailbox, oldrecord.uid));
720 newfname = xstrdup(mailbox_message_fname(mailbox, newrecord.uid));
722721 r = mailbox_copyfile(oldfname, newfname, 0);
723722 free(oldfname);
724723 free(newfname);
725724 if (r) return r;
726725
727 /* and append the new record (a clone apart from the EXPUNGED flag) */
728 r = mailbox_append_index_record(mailbox, &record);
726 /* append the new record */
727 r = mailbox_append_index_record(mailbox, &newrecord);
728 if (r) return r;
729
730 /* and expunge the old record */
731 oldrecord.system_flags |= FLAG_EXPUNGED;
732 r = mailbox_rewrite_index_record(mailbox, &oldrecord);
729733
730734 /* done - return */
731735 return r;
25982602 syslog(LOG_ERR, "unable to setsocketopt(TCP_NODELAY): %m");
25992603 }
26002604
2601 /* turn on TCP keepalive if set */
2602 if (config_getswitch(IMAPOPT_TCP_KEEPALIVE)) {
2605 /* turn on TCP keepalive if set */
2606 if (config_getswitch(IMAPOPT_TCP_KEEPALIVE)) {
26032607 int r;
2604 int optval = 1;
2605 socklen_t optlen = sizeof(optval);
2606
2607 r = setsockopt(sync_backend->sock, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen);
2608 if (r < 0) {
2609 syslog(LOG_ERR, "unable to setsocketopt(SO_KEEPALIVE): %m");
2610 }
2608 int optval = 1;
2609 socklen_t optlen = sizeof(optval);
2610 struct protoent *proto = getprotobyname("TCP");
2611
2612 r = setsockopt(sync_backend->sock, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen);
2613 if (r < 0) {
2614 syslog(LOG_ERR, "unable to setsocketopt(SO_KEEPALIVE): %m");
2615 }
26112616 #ifdef TCP_KEEPCNT
2612 if (config_getint(IMAPOPT_TCP_KEEPALIVE_CNT)) {
2613 r = setsockopt(sync_backend->sock, SOL_TCP, TCP_KEEPCNT, &optval, optlen);
2614 if (r < 0) {
2615 syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPCNT): %m");
2616 }
2617 }
2617 optval = config_getint(IMAPOPT_TCP_KEEPALIVE_CNT);
2618 if (optval) {
2619 r = setsockopt(sync_backend->sock, proto->p_proto, TCP_KEEPCNT, &optval, optlen);
2620 if (r < 0) {
2621 syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPCNT): %m");
2622 }
2623 }
26182624 #endif
26192625 #ifdef TCP_KEEPIDLE
2620 if (config_getint(IMAPOPT_TCP_KEEPALIVE_IDLE)) {
2621 r = setsockopt(sync_backend->sock, SOL_TCP, TCP_KEEPIDLE, &optval, optlen);
2622 if (r < 0) {
2623 syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPIDLE): %m");
2624 }
2625 }
2626 optval = config_getint(IMAPOPT_TCP_KEEPALIVE_IDLE);
2627 if (optval) {
2628 r = setsockopt(sync_backend->sock, proto->p_proto, TCP_KEEPIDLE, &optval, optlen);
2629 if (r < 0) {
2630 syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPIDLE): %m");
2631 }
2632 }
26262633 #endif
26272634 #ifdef TCP_KEEPINTVL
2628 if (config_getint(IMAPOPT_TCP_KEEPALIVE_INTVL)) {
2629 r = setsockopt(sync_backend->sock, SOL_TCP, TCP_KEEPINTVL, &optval, optlen);
2630 if (r < 0) {
2631 syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPINTVL): %m");
2632 }
2633 }
2635 optval = config_getint(IMAPOPT_TCP_KEEPALIVE_INTVL);
2636 if (optval) {
2637 r = setsockopt(sync_backend->sock, proto->p_proto, TCP_KEEPINTVL, &optval, optlen);
2638 if (r < 0) {
2639 syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPINTVL): %m");
2640 }
2641 }
26342642 #endif
26352643 }
26362644 } else {
26572665 /* links to sockets */
26582666 sync_in = sync_backend->in;
26592667 sync_out = sync_backend->out;
2668
2669 /* Force use of LITERAL+ so we don't need two way communications */
2670 prot_setisclient(sync_in, 1);
2671 prot_setisclient(sync_out, 1);
2672
26602673 }
26612674
26622675 static void replica_disconnect()
143143
144144 /* Nuke subscriptions */
145145 list = sync_name_list_create();
146 r = (sync_namespacep->mboxlist_findsub)(sync_namespacep, "*", 1,
147 (char *)userid, sync_authstate,
148 addmbox_sub, (void *)list, 1);
146 r = mboxlist_allsubs(userid, addmbox_sub, list);
149147 if (r) goto fail;
150148
151149 /* ignore failures here - the subs file gets deleted soon anyway */
348348 sync_in = prot_new(0, 0);
349349 sync_out = prot_new(1, 1);
350350
351 /* Force use of LITERAL+ so we don't need two way communications */
352 prot_setisclient(sync_in, 1);
353 prot_setisclient(sync_out, 1);
354
351355 /* Find out name of client host */
352356 salen = sizeof(sync_remoteaddr);
353357 if (getpeername(0, (struct sockaddr *)&sync_remoteaddr, &salen) == 0 &&
15721572 }
15731573
15741574 just_write:
1575 record->silent = 1;
15761575 return mailbox_append_index_record(mailbox, record);
15771576 }
15781577
7474 #endif
7575
7676 #include "assert.h"
77 #include "bsearch.h"
7778 #include "cyrusdb.h"
7879 #include "exitcodes.h"
7980 #include "hash.h"
114115 char *data; /* allocated buffer for fetched data */
115116
116117 struct txn txn; /* transaction associated with this db handle */
118
119 /* sorting function */
120 int (*compar) (const void *s1, const void *s2);
117121 };
118122
119123 static int abort_txn(struct db *db __attribute__((unused)), struct txn *tid);
120
124 static int compar_qr(const void *v1, const void *v2);
125 static int compar_qr_mbox(const void *v1, const void *v2);
126
127 /* hash the prefix - either with or without 'user.' part */
128 static char name_to_hashchar(const char *name)
129 {
130 int config_fulldirhash = libcyrus_config_getswitch(CYRUSOPT_FULLDIRHASH);
131 const char *idx;
132
133 if (!*name) return '\0';
134
135 idx = strchr(name, '.'); /* skip past user. */
136 if (idx == NULL) {
137 idx = name;
138 } else {
139 idx++;
140 }
141
142 return (char) dir_hash_c(idx, config_fulldirhash);
143 }
121144
122145 /* simple hash so it's easy to find these things in the filesystem;
123146 our human time is worth more than efficiency */
125148 {
126149 int config_virtdomains = libcyrus_config_getswitch(CYRUSOPT_VIRTDOMAINS);
127150 int config_fulldirhash = libcyrus_config_getswitch(CYRUSOPT_FULLDIRHASH);
128 const char *idx;
129151 char c, *p;
130152 unsigned len;
131153
157179 }
158180 }
159181
160 idx = strchr(qr, '.'); /* skip past user. */
161 if (idx == NULL) {
162 idx = qr;
163 } else {
164 idx++;
165 }
166 c = (char) dir_hash_c(idx, config_fulldirhash);
182 c = name_to_hashchar(qr);
167183
168184 if (snprintf(buf, size, "%s%c/%s", FNAME_QUOTADIR, c, qr) >= (int) size) {
169185 fatal("insufficient buffer size in hash_quota", EC_TEMPFAIL);
332348 return CYRUSDB_IOERROR;
333349 }
334350
351 db->compar = (flags & CYRUSDB_MBOXSORT) ? compar_qr_mbox : compar_qr;
352
335353 *ret = db;
336354 return 0;
337355 }
496514 return strcmp(qr1, qr2);
497515 }
498516
517 static int compar_qr_mbox(const void *v1, const void *v2)
518 {
519 const char *qr1, *qr2;
520 char qrbuf1[MAX_QUOTA_PATH+1], qrbuf2[MAX_QUOTA_PATH+1];
521
522 qr1 = path_to_qr(*((const char **) v1), qrbuf1);
523 qr2 = path_to_qr(*((const char **) v2), qrbuf2);
524
525 return bsearch_compare(qr1, qr2);
526 }
527
499528 #define PATH_ALLOC 100
500529 struct qr_path {
501530 char **path;
508537 int config_fulldirhash = libcyrus_config_getswitch(CYRUSOPT_FULLDIRHASH);
509538 int config_virtdomains = libcyrus_config_getswitch(CYRUSOPT_VIRTDOMAINS);
510539 char *endp;
540 char onlyc = '\0';
511541 int c, i;
512542 DIR *qrdir;
513543 struct dirent *next = NULL;
516546 endp = strstr(quota_path, FNAME_QUOTADIR) + strlen(FNAME_QUOTADIR);
517547 strcpy(endp, "?/");
518548
549 /* check for path restriction - if there's a prefix we only
550 * need to scan a single directory */
551 onlyc = name_to_hashchar(prefix);
552
519553 c = config_fulldirhash ? 'A' : 'a';
520554 for (i = 0; i < 26; i++, c++) {
555 if (onlyc && c != onlyc) continue;
521556 *endp = c;
522557
523558 qrdir = opendir(quota_path);
600635 DIR *qrdir;
601636 struct dirent *next = NULL;
602637
603 n = snprintf(quota_path, sizeof(quota_path), "%s%s",
638 n = snprintf(quota_path, sizeof(quota_path)-3, "%s%s",
604639 db->path, FNAME_DOMAINDIR);
605640
606641 endp = quota_path + n;
607 strcpy(endp, "?/");
608642
609643 c = config_fulldirhash ? 'A' : 'a';
610644 for (i = 0; i < 26; i++, c++) {
611 *endp = c;
645 endp[0] = c;
646 endp[1] = '/';
647 endp[2] = '\0';
612648
613649 qrdir = opendir(quota_path);
614650
632668 if (tid && !*tid) *tid = &db->txn;
633669
634670 /* sort the quotaroots (ignoring paths) */
635 qsort(pathbuf.path, pathbuf.count, sizeof(char *), &compar_qr);
671 qsort(pathbuf.path, pathbuf.count, sizeof(char *), db->compar);
636672
637673 for (i = 0; i < pathbuf.count; i++) {
638674 const char *data, *key;
643679
644680 key = path_to_qr(pathbuf.path[i], quota_path);
645681 keylen = strlen(key);
646
647 free(pathbuf.path[i]);
648682
649683 if (!goodp || goodp(rock, key, keylen, data, datalen)) {
650684 /* make callback */
652686 if (r) break;
653687 }
654688 }
689 for (i = 0; i < pathbuf.count; i++)
690 free(pathbuf.path[i]);
655691
656692 free(pathbuf.path);
657693
18071807 db->fd = oldfd;
18081808 unlink(fname);
18091809 }
1810
1811 /* release old write lock */
1812 close(oldfd);
1813
1814 {
1810 else {
18151811 struct stat sbuf;
1812
1813 /* remove content of old file so it doesn't sit around using disk */
1814 ftruncate(oldfd, 0);
1815
1816 /* release old write lock */
1817 close(oldfd);
18161818
18171819 /* let's make sure we're up to date */
18181820 map_free(&db->map_base, &db->map_len);
240240 /* Maximum number of transactions to be supported in the berkeley
241241 environment. */
242242
243 { "boundary_limit", 1000, INT }
244 /* messages are parsed recursively and a deep enough MIME structure
245 can cause a stack overflow. Do not parse deeper than this many
246 layers of MIME structure. The default of 1000 is much higher
247 than any sane message should have. */
248
243249 { "client_timeout", 10, INT }
244250 /* Number of seconds to wait before returning a timeout failure when
245251 performing a client connection (e.g., in a murder environment) */
292298 installations. Lists the old RFC 2086 right which was used to
293299 grant the user the ability to delete a mailbox. If a user has this
294300 right, they will automatically be given the new 'x' right. */
301
302 { "disable_user_namespace", 0, SWITCH }
303 /* Preclude list command on user namespace. If set to 'yes', the
304 LIST response will never include any other user's mailbox. Admin
305 users will always see all mailboxes. The default is 'no' */
306
307 { "disable_shared_namespace", 0, SWITCH }
308 /* Preclude list command on user namespace. If set to 'yes', the
309 LIST response will never include any non-user mailboxes. Admin
310 users will always see all mailboxes. The default is 'no' */
295311
296312 { "disconnect_on_vanished_mailbox", 0, SWITCH }
297313 /* If enabled, IMAP/POP3/NNTP clients will be disconnected by the
596612 will cause the user's mailbox to exceed its quota. By default, the
597613 failure won't occur until the mailbox is already over quota. */
598614
615 { "lmtp_strict_rfc2821", 1, SWITCH }
616 /* By default, lmtpd will be strict (per RFC 2821) with regards to which
617 envelope addresses are allowed. If this option is set to false, 8bit
618 characters in the local-part of envelope addresses are changed to 'X'
619 instead. This is useful to avoid generating backscatter with
620 certain MTAs like Postfix or Exim which accept such messages. */
621
599622 { "lmtpsocket", "{configdirectory}/socket/lmtp", STRING }
600623 /* Unix domain socket that lmtpd listens on, used by deliver(8). This should
601624 match the path specified in cyrus.conf(5). */
625
626 { "lmtptxn_timeout", 300, INT }
627 /* Timeout (in seconds) used during a lmtp transaction to a remote backend
628 (e.g. in a murder environment). Can be used to prevent hung lmtpds
629 on proxy hosts when a backend server becomes unresponsive during a
630 lmtp transaction. The default is 300 - change to zero for infinite. */
602631
603632 # xxx how does this tie into virtual domains?
604633 { "loginrealms", "", STRING }
9696 { IMAPOPT_BERKELEY_TXNS_MAX, "berkeley_txns_max", 0, OPT_INT,
9797 {(void*)100},
9898 { { NULL, IMAP_ENUM_ZERO } } },
99 { IMAPOPT_BOUNDARY_LIMIT, "boundary_limit", 0, OPT_INT,
100 {(void*)1000},
101 { { NULL, IMAP_ENUM_ZERO } } },
99102 { IMAPOPT_CLIENT_TIMEOUT, "client_timeout", 0, OPT_INT,
100103 {(void*)10},
101104 { { NULL, IMAP_ENUM_ZERO } } },
130133 { NULL, IMAP_ENUM_ZERO } } },
131134 { IMAPOPT_DELETERIGHT, "deleteright", 0, OPT_STRING,
132135 {(void *)("c")},
136 { { NULL, IMAP_ENUM_ZERO } } },
137 { IMAPOPT_DISABLE_USER_NAMESPACE, "disable_user_namespace", 0, OPT_SWITCH,
138 {(void*)0},
139 { { NULL, IMAP_ENUM_ZERO } } },
140 { IMAPOPT_DISABLE_SHARED_NAMESPACE, "disable_shared_namespace", 0, OPT_SWITCH,
141 {(void*)0},
133142 { { NULL, IMAP_ENUM_ZERO } } },
134143 { IMAPOPT_DISCONNECT_ON_VANISHED_MAILBOX, "disconnect_on_vanished_mailbox", 0, OPT_SWITCH,
135144 {(void*)0},
346355 { IMAPOPT_LMTP_STRICT_QUOTA, "lmtp_strict_quota", 0, OPT_SWITCH,
347356 {(void*)0},
348357 { { NULL, IMAP_ENUM_ZERO } } },
358 { IMAPOPT_LMTP_STRICT_RFC2821, "lmtp_strict_rfc2821", 0, OPT_SWITCH,
359 {(void*)1},
360 { { NULL, IMAP_ENUM_ZERO } } },
349361 { IMAPOPT_LMTPSOCKET, "lmtpsocket", 0, OPT_STRING,
350362 {(void *)("{configdirectory}/socket/lmtp")},
363 { { NULL, IMAP_ENUM_ZERO } } },
364 { IMAPOPT_LMTPTXN_TIMEOUT, "lmtptxn_timeout", 0, OPT_INT,
365 {(void*)300},
351366 { { NULL, IMAP_ENUM_ZERO } } },
352367 { IMAPOPT_LOGINREALMS, "loginrealms", 0, OPT_STRING,
353368 {(void *)("")},
3636 IMAPOPT_BERKELEY_CACHESIZE,
3737 IMAPOPT_BERKELEY_LOCKS_MAX,
3838 IMAPOPT_BERKELEY_TXNS_MAX,
39 IMAPOPT_BOUNDARY_LIMIT,
3940 IMAPOPT_CLIENT_TIMEOUT,
4041 IMAPOPT_COMMANDMINTIMER,
4142 IMAPOPT_CONFIGDIRECTORY,
4748 IMAPOPT_DELETEDPREFIX,
4849 IMAPOPT_DELETE_MODE,
4950 IMAPOPT_DELETERIGHT,
51 IMAPOPT_DISABLE_USER_NAMESPACE,
52 IMAPOPT_DISABLE_SHARED_NAMESPACE,
5053 IMAPOPT_DISCONNECT_ON_VANISHED_MAILBOX,
5154 IMAPOPT_DUPLICATE_DB,
5255 IMAPOPT_DUPLICATE_DB_PATH,
110113 IMAPOPT_LMTP_FUZZY_MAILBOX_MATCH,
111114 IMAPOPT_LMTP_OVER_QUOTA_PERM_FAILURE,
112115 IMAPOPT_LMTP_STRICT_QUOTA,
116 IMAPOPT_LMTP_STRICT_RFC2821,
113117 IMAPOPT_LMTPSOCKET,
118 IMAPOPT_LMTPTXN_TIMEOUT,
114119 IMAPOPT_LOGINREALMS,
115120 IMAPOPT_LOGINUSEACL,
116121 IMAPOPT_LOGTIMESTAMPS,
105105 case '@':
106106 tok = parseaddr_domain(&s, &domain, &comment);
107107 parseaddr_append(&addrp, comment, 0, phrase, domain, &freeme);
108 if (tok == ';') {
109 parseaddr_append(&addrp, 0, 0, 0, 0, &freeme);
110 ingroup = 0;
111 }
108112 continue;
109113
110114 case '<':
263263 return 0;
264264 }
265265
266 /*
267 * Turn off SASL for this connection
268 */
269
270 void prot_unsetsasl(struct protstream *s)
271 {
272 s->conn = NULL;
273 s->maxplain = PROT_BUFSIZE;
274 s->saslssf = 0;
275 }
276
266277 #ifdef HAVE_ZLIB
267278
268279 #define ZLARGE_DIFF_CHUNK (5120) /* 5K */
195195 /* Set the SASL options for a protstream (requires authentication to
196196 * be complete for the given sasl_conn_t */
197197 extern int prot_setsasl(struct protstream *s, sasl_conn_t *conn);
198 extern void prot_unsetsasl(struct protstream *s);
198199
199200 #ifdef HAVE_SSL
200201 /* Set TLS options for a given protstream (requires a completed tls
220220 .IP "\fBberkeley_txns_max:\fR 100" 5
221221 Maximum number of transactions to be supported in the berkeley
222222 environment.
223 .IP "\fBboundary_limit:\fR 1000" 5
224 messages are parsed recursively and a deep enough MIME structure
225 can cause a stack overflow. Do not parse deeper than this many
226 layers of MIME structure. The default of 1000 is much higher
227 than any sane message should have.
223228 .IP "\fBclient_timeout:\fR 10" 5
224229 Number of seconds to wait before returning a timeout failure when
225230 performing a client connection (e.g., in a murder environment)
264269 installations. Lists the old RFC 2086 right which was used to
265270 grant the user the ability to delete a mailbox. If a user has this
266271 right, they will automatically be given the new 'x' right.
272 .IP "\fBdisable_user_namespace:\fR 0" 5
273 Preclude list command on user namespace. If set to 'yes', the
274 LIST response will never include any other user's mailbox. Admin
275 users will always see all mailboxes. The default is 'no'
276 .IP "\fBdisable_shared_namespace:\fR 0" 5
277 Preclude list command on user namespace. If set to 'yes', the
278 LIST response will never include any non-user mailboxes. Admin
279 users will always see all mailboxes. The default is 'no'
267280 .IP "\fBdisconnect_on_vanished_mailbox:\fR 0" 5
268281 If enabled, IMAP/POP3/NNTP clients will be disconnected by the
269282 server if the currently selected mailbox is (re)moved by another
511524 If enabled, lmtpd returns a failure code when the incoming message
512525 will cause the user's mailbox to exceed its quota. By default, the
513526 failure won't occur until the mailbox is already over quota.
527 .IP "\fBlmtp_strict_rfc2821:\fR 1" 5
528 By default, lmtpd will be strict (per RFC 2821) with regards to which
529 envelope addresses are allowed. If this option is set to false, 8bit
530 characters in the local-part of envelope addresses are changed to 'X'
531 instead. This is useful to avoid generating backscatter with
532 certain MTAs like Postfix or Exim which accept such messages.
514533 .IP "\fBlmtpsocket:\fR {configdirectory}/socket/lmtp" 5
515534 Unix domain socket that lmtpd listens on, used by deliver(8). This should
516535 match the path specified in cyrus.conf(5).
536 .IP "\fBlmtptxn_timeout:\fR 300" 5
537 Timeout (in seconds) used during a lmtp transaction to a remote backend
538 (e.g. in a murder environment). Can be used to prevent hung lmtpds
539 on proxy hosts when a backend server becomes unresponsive during a
540 lmtp transaction. The default is 300 - change to zero for infinite.
517541 .IP "\fBloginrealms:\fR <empty string>" 5
518542 The list of remote realms whose users may authenticate using cross-realm
519543 authentication identifiers. Separate each realm name by a space. (A
6363 [
6464 .B \-s
6565 ]
66 [
67 .B \-o
68 ]
6669 .br
6770 [
6871 .BI \-d " days"
128131 .TP
129132 .B \-s
130133 Skip over messages that have the \\Flagged flag set.
134 .TP
135 .B \-o
136 Only purge messages that have the \\Deleted flag set.
131137 .SH FILES
132138 .TP
133139 .B /etc/imapd.conf
0 .\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
0 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
11 .\"
22 .\" Standard preamble:
33 .\" ========================================================================
123123 .\" ========================================================================
124124 .\"
125125 .IX Title "SIEVESHELL 1"
126 .TH SIEVESHELL 1 "2011-06-21" "perl v5.10.1" "User Contributed Perl Documentation"
126 .TH SIEVESHELL 1 "2011-09-08" "perl v5.12.4" "User Contributed Perl Documentation"
127127 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
128128 .\" way too many mistakes in technical documents.
129129 .if n .ad l
14821482 proto = NULL; /* avoid freeing it */
14831483
14841484 Services[i].exec = tokenize(cmd);
1485 cmd = NULL; /* avoid freeing it */
14861485 if (!Services[i].exec) fatal("out of memory", EX_UNAVAILABLE);
14871486
14881487 /* is this service actually there? */
15351534 Services[i].desired_workers,
15361535 Services[i].max_workers,
15371536 (int) Services[i].maxfds);
1537
1538 cmd = NULL; /* avoid freeing it */
15381539
15391540 done:
15401541 free(cmd);
519519 int r;
520520 int optval = 1;
521521 socklen_t optlen = sizeof(optval);
522 struct protoent *proto = getprotobyname("TCP");
522523
523524 r = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen);
524525 if (r < 0) {
527528 #ifdef TCP_KEEPCNT
528529 optval = config_getint(IMAPOPT_TCP_KEEPALIVE_CNT);
529530 if (optval) {
530 r = setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &optval, optlen);
531 r = setsockopt(fd, proto->p_proto, TCP_KEEPCNT, &optval, optlen);
531532 if (r < 0) {
532533 syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPCNT): %m");
533534 }
536537 #ifdef TCP_KEEPIDLE
537538 optval = config_getint(IMAPOPT_TCP_KEEPALIVE_IDLE);
538539 if (optval) {
539 r = setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &optval, optlen);
540 r = setsockopt(fd, proto->p_proto, TCP_KEEPIDLE, &optval, optlen);
540541 if (r < 0) {
541542 syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPIDLE): %m");
542543 }
545546 #ifdef TCP_KEEPINTVL
546547 optval = config_getint(IMAPOPT_TCP_KEEPALIVE_INTVL);
547548 if (optval) {
548 r = setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &optval, optlen);
549 r = setsockopt(fd, proto->p_proto, TCP_KEEPINTVL, &optval, optlen);
549550 if (r < 0) {
550551 syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPINTVL): %m");
551552 }
480480 if ((rc = pr_ListMembers(canon_id_tmp, &groups))) {
481481 /* Failure may indicate that we need new tokens */
482482 pr_End();
483 rc = pr_Initialize (1L, AFSCONF_CLIENTNAME, 0);
483 rc = pr_Initialize (1L, AFSCONF_CLIENTNAME, config_getstring(IMAPOPT_AFSPTS_MYCELL));
484484 if (rc) {
485485 syslog(LOG_DEBUG, "pr_Initialize failed: %d", rc);
486486 fatal("pr_Initialize failed", EC_TEMPFAIL);
0 #ifndef lint
1 static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
2 #endif
3
4 #define YYBYACC 1
5 #define YYMAJOR 1
6 #define YYMINOR 9
7 #define YYPATCH 20100610
8
9 #define YYEMPTY (-1)
10 #define yyclearin (yychar = YYEMPTY)
11 #define yyerrok (yyerrflag = 0)
12 #define YYRECOVERING() (yyerrflag != 0)
13
14
15 #ifndef yyparse
16 #define yyparse addrparse
17 #endif /* yyparse */
18
19 #ifndef yylex
20 #define yylex addrlex
21 #endif /* yylex */
22
23 #ifndef yyerror
24 #define yyerror addrerror
25 #endif /* yyerror */
26
27 #ifndef yychar
28 #define yychar addrchar
29 #endif /* yychar */
30
31 #ifndef yyval
32 #define yyval addrval
33 #endif /* yyval */
34
35 #ifndef yylval
36 #define yylval addrlval
37 #endif /* yylval */
38
39 #ifndef yydebug
40 #define yydebug addrdebug
41 #endif /* yydebug */
42
43 #ifndef yynerrs
44 #define yynerrs addrnerrs
45 #endif /* yynerrs */
46
47 #ifndef yyerrflag
48 #define yyerrflag addrerrflag
49 #endif /* yyerrflag */
50
51 #ifndef yylhs
52 #define yylhs addrlhs
53 #endif /* yylhs */
54
55 #ifndef yylen
56 #define yylen addrlen
57 #endif /* yylen */
58
59 #ifndef yydefred
60 #define yydefred addrdefred
61 #endif /* yydefred */
62
63 #ifndef yydgoto
64 #define yydgoto addrdgoto
65 #endif /* yydgoto */
66
67 #ifndef yysindex
68 #define yysindex addrsindex
69 #endif /* yysindex */
70
71 #ifndef yyrindex
72 #define yyrindex addrrindex
73 #endif /* yyrindex */
74
75 #ifndef yygindex
76 #define yygindex addrgindex
77 #endif /* yygindex */
78
79 #ifndef yytable
80 #define yytable addrtable
81 #endif /* yytable */
82
83 #ifndef yycheck
84 #define yycheck addrcheck
85 #endif /* yycheck */
86
87 #ifndef yyname
88 #define yyname addrname
89 #endif /* yyname */
90
91 #ifndef yyrule
92 #define yyrule addrrule
93 #endif /* yyrule */
94 #define YYPREFIX "addr"
95
0
1 /* A Bison parser, made by GNU Bison 2.4.1. */
2
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
43
44 /* Identify Bison output. */
45 #define YYBISON 1
46
47 /* Bison version. */
48 #define YYBISON_VERSION "2.4.1"
49
50 /* Skeleton name. */
51 #define YYSKELETON_NAME "yacc.c"
52
53 /* Pure parsers. */
9654 #define YYPURE 0
9755
98 #line 2 "addr.y"
56 /* Push parsers. */
57 #define YYPUSH 0
58
59 /* Pull parsers. */
60 #define YYPULL 1
61
62 /* Using locations. */
63 #define YYLSP_NEEDED 0
64
65 /* Substitute the variable and function names. */
66 #define yyparse addrparse
67 #define yylex addrlex
68 #define yyerror addrerror
69 #define yylval addrlval
70 #define yychar addrchar
71 #define yydebug addrdebug
72 #define yynerrs addrnerrs
73
74
75 /* Copy the first part of user declarations. */
76
77 /* Line 189 of yacc.c */
78 #line 1 "addr.y"
79
9980 /*
10081 * addr.y -- RFC 822 address parser
10182 * Ken Murchison
164145 /* byacc default is 500, bison default is 10000 - go with the
165146 larger to support big sieve scripts (see Bug #3461) */
166147 #define YYSTACKSIZE 10000
167 #line 168 "y.tab.c"
168
169 #ifndef YYSTYPE
148
149
150 /* Line 189 of yacc.c */
151 #line 153 "y.tab.c"
152
153 /* Enabling traces. */
154 #ifndef YYDEBUG
155 # define YYDEBUG 0
156 #endif
157
158 /* Enabling verbose error messages. */
159 #ifdef YYERROR_VERBOSE
160 # undef YYERROR_VERBOSE
161 # define YYERROR_VERBOSE 1
162 #else
163 # define YYERROR_VERBOSE 0
164 #endif
165
166 /* Enabling the token table. */
167 #ifndef YYTOKEN_TABLE
168 # define YYTOKEN_TABLE 0
169 #endif
170
171
172 /* Tokens. */
173 #ifndef YYTOKENTYPE
174 # define YYTOKENTYPE
175 /* Put the tokens into the symbol table, so that GDB and other debuggers
176 know about them. */
177 enum yytokentype {
178 ATOM = 258,
179 QTEXT = 259,
180 DTEXT = 260
181 };
182 #endif
183 /* Tokens. */
184 #define ATOM 258
185 #define QTEXT 259
186 #define DTEXT 260
187
188
189
190
191 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
170192 typedef int YYSTYPE;
171 #endif
172
173 /* compatibility with bison */
193 # define YYSTYPE_IS_TRIVIAL 1
194 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
195 # define YYSTYPE_IS_DECLARED 1
196 #endif
197
198
199 /* Copy the second part of user declarations. */
200
201
202 /* Line 264 of yacc.c */
203 #line 205 "y.tab.c"
204
205 #ifdef short
206 # undef short
207 #endif
208
209 #ifdef YYTYPE_UINT8
210 typedef YYTYPE_UINT8 yytype_uint8;
211 #else
212 typedef unsigned char yytype_uint8;
213 #endif
214
215 #ifdef YYTYPE_INT8
216 typedef YYTYPE_INT8 yytype_int8;
217 #elif (defined __STDC__ || defined __C99__FUNC__ \
218 || defined __cplusplus || defined _MSC_VER)
219 typedef signed char yytype_int8;
220 #else
221 typedef short int yytype_int8;
222 #endif
223
224 #ifdef YYTYPE_UINT16
225 typedef YYTYPE_UINT16 yytype_uint16;
226 #else
227 typedef unsigned short int yytype_uint16;
228 #endif
229
230 #ifdef YYTYPE_INT16
231 typedef YYTYPE_INT16 yytype_int16;
232 #else
233 typedef short int yytype_int16;
234 #endif
235
236 #ifndef YYSIZE_T
237 # ifdef __SIZE_TYPE__
238 # define YYSIZE_T __SIZE_TYPE__
239 # elif defined size_t
240 # define YYSIZE_T size_t
241 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
242 || defined __cplusplus || defined _MSC_VER)
243 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
244 # define YYSIZE_T size_t
245 # else
246 # define YYSIZE_T unsigned int
247 # endif
248 #endif
249
250 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
251
252 #ifndef YY_
253 # if YYENABLE_NLS
254 # if ENABLE_NLS
255 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
256 # define YY_(msgid) dgettext ("bison-runtime", msgid)
257 # endif
258 # endif
259 # ifndef YY_
260 # define YY_(msgid) msgid
261 # endif
262 #endif
263
264 /* Suppress unused-variable warnings by "using" E. */
265 #if ! defined lint || defined __GNUC__
266 # define YYUSE(e) ((void) (e))
267 #else
268 # define YYUSE(e) /* empty */
269 #endif
270
271 /* Identity function, used to suppress warnings about constant conditions. */
272 #ifndef lint
273 # define YYID(n) (n)
274 #else
275 #if (defined __STDC__ || defined __C99__FUNC__ \
276 || defined __cplusplus || defined _MSC_VER)
277 static int
278 YYID (int yyi)
279 #else
280 static int
281 YYID (yyi)
282 int yyi;
283 #endif
284 {
285 return yyi;
286 }
287 #endif
288
289 #if ! defined yyoverflow || YYERROR_VERBOSE
290
291 /* The parser invokes alloca or malloc; define the necessary symbols. */
292
293 # ifdef YYSTACK_USE_ALLOCA
294 # if YYSTACK_USE_ALLOCA
295 # ifdef __GNUC__
296 # define YYSTACK_ALLOC __builtin_alloca
297 # elif defined __BUILTIN_VA_ARG_INCR
298 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
299 # elif defined _AIX
300 # define YYSTACK_ALLOC __alloca
301 # elif defined _MSC_VER
302 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
303 # define alloca _alloca
304 # else
305 # define YYSTACK_ALLOC alloca
306 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
307 || defined __cplusplus || defined _MSC_VER)
308 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
309 # ifndef _STDLIB_H
310 # define _STDLIB_H 1
311 # endif
312 # endif
313 # endif
314 # endif
315 # endif
316
317 # ifdef YYSTACK_ALLOC
318 /* Pacify GCC's `empty if-body' warning. */
319 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
320 # ifndef YYSTACK_ALLOC_MAXIMUM
321 /* The OS might guarantee only one guard page at the bottom of the stack,
322 and a page size can be as small as 4096 bytes. So we cannot safely
323 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
324 to allow for a few compiler-allocated temporary stack slots. */
325 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
326 # endif
327 # else
328 # define YYSTACK_ALLOC YYMALLOC
329 # define YYSTACK_FREE YYFREE
330 # ifndef YYSTACK_ALLOC_MAXIMUM
331 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
332 # endif
333 # if (defined __cplusplus && ! defined _STDLIB_H \
334 && ! ((defined YYMALLOC || defined malloc) \
335 && (defined YYFREE || defined free)))
336 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
337 # ifndef _STDLIB_H
338 # define _STDLIB_H 1
339 # endif
340 # endif
341 # ifndef YYMALLOC
342 # define YYMALLOC malloc
343 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
344 || defined __cplusplus || defined _MSC_VER)
345 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
346 # endif
347 # endif
348 # ifndef YYFREE
349 # define YYFREE free
350 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
351 || defined __cplusplus || defined _MSC_VER)
352 void free (void *); /* INFRINGES ON USER NAME SPACE */
353 # endif
354 # endif
355 # endif
356 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
357
358
359 #if (! defined yyoverflow \
360 && (! defined __cplusplus \
361 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
362
363 /* A type that is properly aligned for any stack member. */
364 union yyalloc
365 {
366 yytype_int16 yyss_alloc;
367 YYSTYPE yyvs_alloc;
368 };
369
370 /* The size of the maximum gap between one aligned stack and the next. */
371 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
372
373 /* The size of an array large to enough to hold all stacks, each with
374 N elements. */
375 # define YYSTACK_BYTES(N) \
376 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
377 + YYSTACK_GAP_MAXIMUM)
378
379 /* Copy COUNT objects from FROM to TO. The source and destination do
380 not overlap. */
381 # ifndef YYCOPY
382 # if defined __GNUC__ && 1 < __GNUC__
383 # define YYCOPY(To, From, Count) \
384 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
385 # else
386 # define YYCOPY(To, From, Count) \
387 do \
388 { \
389 YYSIZE_T yyi; \
390 for (yyi = 0; yyi < (Count); yyi++) \
391 (To)[yyi] = (From)[yyi]; \
392 } \
393 while (YYID (0))
394 # endif
395 # endif
396
397 /* Relocate STACK from its old location to the new one. The
398 local variables YYSIZE and YYSTACKSIZE give the old and new number of
399 elements in the stack, and YYPTR gives the new location of the
400 stack. Advance YYPTR to a properly aligned location for the next
401 stack. */
402 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
403 do \
404 { \
405 YYSIZE_T yynewbytes; \
406 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
407 Stack = &yyptr->Stack_alloc; \
408 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
409 yyptr += yynewbytes / sizeof (*yyptr); \
410 } \
411 while (YYID (0))
412
413 #endif
414
415 /* YYFINAL -- State number of the termination state. */
416 #define YYFINAL 10
417 /* YYLAST -- Last index in YYTABLE. */
418 #define YYLAST 26
419
420 /* YYNTOKENS -- Number of terminals. */
421 #define YYNTOKENS 13
422 /* YYNNTS -- Number of nonterminals. */
423 #define YYNNTS 11
424 /* YYNRULES -- Number of rules. */
425 #define YYNRULES 17
426 /* YYNRULES -- Number of states. */
427 #define YYNSTATES 31
428
429 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
430 #define YYUNDEFTOK 2
431 #define YYMAXUTOK 260
432
433 #define YYTRANSLATE(YYX) \
434 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
435
436 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
437 static const yytype_uint8 yytranslate[] =
438 {
439 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 12, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 9, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 6, 2, 7, 2, 8, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 10, 2, 11, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
465 5
466 };
467
468 #if YYDEBUG
469 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
470 YYRHS. */
471 static const yytype_uint8 yyprhs[] =
472 {
473 0, 0, 3, 5, 10, 14, 16, 20, 22, 26,
474 28, 30, 32, 36, 38, 41, 43, 45
475 };
476
477 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
478 static const yytype_int8 yyrhs[] =
479 {
480 14, 0, -1, 15, -1, 21, 6, 15, 7, -1,
481 16, 8, 17, -1, 22, -1, 22, 9, 16, -1,
482 18, -1, 18, 9, 17, -1, 19, -1, 20, -1,
483 3, -1, 10, 5, 11, -1, 22, -1, 22, 21,
484 -1, 3, -1, 23, -1, 12, 4, 12, -1
485 };
486
487 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
488 static const yytype_uint8 yyrline[] =
489 {
490 0, 75, 75, 76, 79, 82, 83, 86, 87, 90,
491 91, 94, 97, 100, 101, 104, 105, 108
492 };
493 #endif
494
495 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
496 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
497 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
498 static const char *const yytname[] =
499 {
500 "$end", "error", "$undefined", "ATOM", "QTEXT", "DTEXT", "'<'", "'>'",
501 "'@'", "'.'", "'['", "']'", "'\"'", "$accept", "sieve_address",
502 "addrspec", "localpart", "domain", "subdomain", "domainref", "domainlit",
503 "phrase", "word", "qstring", 0
504 };
505 #endif
506
507 # ifdef YYPRINT
508 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
509 token YYLEX-NUM. */
510 static const yytype_uint16 yytoknum[] =
511 {
512 0, 256, 257, 258, 259, 260, 60, 62, 64, 46,
513 91, 93, 34
514 };
515 # endif
516
517 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
518 static const yytype_uint8 yyr1[] =
519 {
520 0, 13, 14, 14, 15, 16, 16, 17, 17, 18,
521 18, 19, 20, 21, 21, 22, 22, 23
522 };
523
524 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
525 static const yytype_uint8 yyr2[] =
526 {
527 0, 2, 1, 4, 3, 1, 3, 1, 3, 1,
528 1, 1, 3, 1, 2, 1, 1, 3
529 };
530
531 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
532 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
533 means the default is an error. */
534 static const yytype_uint8 yydefact[] =
535 {
536 0, 15, 0, 0, 2, 0, 0, 5, 16, 0,
537 1, 0, 0, 0, 14, 13, 17, 11, 0, 4,
538 7, 9, 10, 0, 5, 6, 0, 0, 3, 12,
539 8
540 };
541
542 /* YYDEFGOTO[NTERM-NUM]. */
543 static const yytype_int8 yydefgoto[] =
544 {
545 -1, 3, 4, 5, 19, 20, 21, 22, 14, 15,
546 8
547 };
548
549 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
550 STATE-NUM. */
551 #define YYPACT_NINF -7
552 static const yytype_int8 yypact[] =
553 {
554 -1, -7, 1, 3, -7, 6, 10, -2, -7, -6,
555 -7, 5, -1, -1, -7, -1, -7, -7, 4, -7,
556 8, -7, -7, 11, 12, -7, 9, 5, -7, -7,
557 -7
558 };
559
560 /* YYPGOTO[NTERM-NUM]. */
561 static const yytype_int8 yypgoto[] =
562 {
563 -7, -7, 7, 13, -5, -7, -7, -7, 23, 0,
564 -7
565 };
566
567 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
568 positive, shift that token. If negative, reduce the rule which
569 number is the opposite. If zero, do what YYDEFACT says.
570 If YYTABLE_NINF, syntax error. */
571 #define YYTABLE_NINF -14
572 static const yytype_int8 yytable[] =
573 {
574 7, 1, 1, 10, -13, 9, 16, 13, 17, 26,
575 2, 2, 24, 24, 11, 18, 12, 27, 28, 23,
576 29, 13, 30, 6, 0, 0, 25
577 };
578
579 static const yytype_int8 yycheck[] =
580 {
581 0, 3, 3, 0, 6, 4, 12, 9, 3, 5,
582 12, 12, 12, 13, 8, 10, 6, 9, 7, 12,
583 11, 9, 27, 0, -1, -1, 13
584 };
585
586 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
587 symbol of state STATE-NUM. */
588 static const yytype_uint8 yystos[] =
589 {
590 0, 3, 12, 14, 15, 16, 21, 22, 23, 4,
591 0, 8, 6, 9, 21, 22, 12, 3, 10, 17,
592 18, 19, 20, 15, 22, 16, 5, 9, 7, 11,
593 17
594 };
595
596 #define yyerrok (yyerrstatus = 0)
597 #define yyclearin (yychar = YYEMPTY)
598 #define YYEMPTY (-2)
599 #define YYEOF 0
600
601 #define YYACCEPT goto yyacceptlab
602 #define YYABORT goto yyabortlab
603 #define YYERROR goto yyerrorlab
604
605
606 /* Like YYERROR except do call yyerror. This remains here temporarily
607 to ease the transition to the new meaning of YYERROR, for GCC.
608 Once GCC version 2 has supplanted version 1, this can go. */
609
610 #define YYFAIL goto yyerrlab
611
612 #define YYRECOVERING() (!!yyerrstatus)
613
614 #define YYBACKUP(Token, Value) \
615 do \
616 if (yychar == YYEMPTY && yylen == 1) \
617 { \
618 yychar = (Token); \
619 yylval = (Value); \
620 yytoken = YYTRANSLATE (yychar); \
621 YYPOPSTACK (1); \
622 goto yybackup; \
623 } \
624 else \
625 { \
626 yyerror (YY_("syntax error: cannot back up")); \
627 YYERROR; \
628 } \
629 while (YYID (0))
630
631
632 #define YYTERROR 1
633 #define YYERRCODE 256
634
635
636 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
637 If N is 0, then set CURRENT to the empty location which ends
638 the previous symbol: RHS[0] (always defined). */
639
640 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
641 #ifndef YYLLOC_DEFAULT
642 # define YYLLOC_DEFAULT(Current, Rhs, N) \
643 do \
644 if (YYID (N)) \
645 { \
646 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
647 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
648 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
649 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
650 } \
651 else \
652 { \
653 (Current).first_line = (Current).last_line = \
654 YYRHSLOC (Rhs, 0).last_line; \
655 (Current).first_column = (Current).last_column = \
656 YYRHSLOC (Rhs, 0).last_column; \
657 } \
658 while (YYID (0))
659 #endif
660
661
662 /* YY_LOCATION_PRINT -- Print the location on the stream.
663 This macro was not mandated originally: define only if we know
664 we won't break user code: when these are the locations we know. */
665
666 #ifndef YY_LOCATION_PRINT
667 # if YYLTYPE_IS_TRIVIAL
668 # define YY_LOCATION_PRINT(File, Loc) \
669 fprintf (File, "%d.%d-%d.%d", \
670 (Loc).first_line, (Loc).first_column, \
671 (Loc).last_line, (Loc).last_column)
672 # else
673 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
674 # endif
675 #endif
676
677
678 /* YYLEX -- calling `yylex' with the right arguments. */
679
680 #ifdef YYLEX_PARAM
681 # define YYLEX yylex (YYLEX_PARAM)
682 #else
683 # define YYLEX yylex ()
684 #endif
685
686 /* Enable debugging if requested. */
687 #if YYDEBUG
688
689 # ifndef YYFPRINTF
690 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
691 # define YYFPRINTF fprintf
692 # endif
693
694 # define YYDPRINTF(Args) \
695 do { \
696 if (yydebug) \
697 YYFPRINTF Args; \
698 } while (YYID (0))
699
700 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
701 do { \
702 if (yydebug) \
703 { \
704 YYFPRINTF (stderr, "%s ", Title); \
705 yy_symbol_print (stderr, \
706 Type, Value); \
707 YYFPRINTF (stderr, "\n"); \
708 } \
709 } while (YYID (0))
710
711
712 /*--------------------------------.
713 | Print this symbol on YYOUTPUT. |
714 `--------------------------------*/
715
716 /*ARGSUSED*/
717 #if (defined __STDC__ || defined __C99__FUNC__ \
718 || defined __cplusplus || defined _MSC_VER)
719 static void
720 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
721 #else
722 static void
723 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
724 FILE *yyoutput;
725 int yytype;
726 YYSTYPE const * const yyvaluep;
727 #endif
728 {
729 if (!yyvaluep)
730 return;
731 # ifdef YYPRINT
732 if (yytype < YYNTOKENS)
733 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
734 # else
735 YYUSE (yyoutput);
736 # endif
737 switch (yytype)
738 {
739 default:
740 break;
741 }
742 }
743
744
745 /*--------------------------------.
746 | Print this symbol on YYOUTPUT. |
747 `--------------------------------*/
748
749 #if (defined __STDC__ || defined __C99__FUNC__ \
750 || defined __cplusplus || defined _MSC_VER)
751 static void
752 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
753 #else
754 static void
755 yy_symbol_print (yyoutput, yytype, yyvaluep)
756 FILE *yyoutput;
757 int yytype;
758 YYSTYPE const * const yyvaluep;
759 #endif
760 {
761 if (yytype < YYNTOKENS)
762 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
763 else
764 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
765
766 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
767 YYFPRINTF (yyoutput, ")");
768 }
769
770 /*------------------------------------------------------------------.
771 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
772 | TOP (included). |
773 `------------------------------------------------------------------*/
774
775 #if (defined __STDC__ || defined __C99__FUNC__ \
776 || defined __cplusplus || defined _MSC_VER)
777 static void
778 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
779 #else
780 static void
781 yy_stack_print (yybottom, yytop)
782 yytype_int16 *yybottom;
783 yytype_int16 *yytop;
784 #endif
785 {
786 YYFPRINTF (stderr, "Stack now");
787 for (; yybottom <= yytop; yybottom++)
788 {
789 int yybot = *yybottom;
790 YYFPRINTF (stderr, " %d", yybot);
791 }
792 YYFPRINTF (stderr, "\n");
793 }
794
795 # define YY_STACK_PRINT(Bottom, Top) \
796 do { \
797 if (yydebug) \
798 yy_stack_print ((Bottom), (Top)); \
799 } while (YYID (0))
800
801
802 /*------------------------------------------------.
803 | Report that the YYRULE is going to be reduced. |
804 `------------------------------------------------*/
805
806 #if (defined __STDC__ || defined __C99__FUNC__ \
807 || defined __cplusplus || defined _MSC_VER)
808 static void
809 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
810 #else
811 static void
812 yy_reduce_print (yyvsp, yyrule)
813 YYSTYPE *yyvsp;
814 int yyrule;
815 #endif
816 {
817 int yynrhs = yyr2[yyrule];
818 int yyi;
819 unsigned long int yylno = yyrline[yyrule];
820 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
821 yyrule - 1, yylno);
822 /* The symbols being reduced. */
823 for (yyi = 0; yyi < yynrhs; yyi++)
824 {
825 YYFPRINTF (stderr, " $%d = ", yyi + 1);
826 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
827 &(yyvsp[(yyi + 1) - (yynrhs)])
828 );
829 YYFPRINTF (stderr, "\n");
830 }
831 }
832
833 # define YY_REDUCE_PRINT(Rule) \
834 do { \
835 if (yydebug) \
836 yy_reduce_print (yyvsp, Rule); \
837 } while (YYID (0))
838
839 /* Nonzero means print parse trace. It is left uninitialized so that
840 multiple parsers can coexist. */
841 int yydebug;
842 #else /* !YYDEBUG */
843 # define YYDPRINTF(Args)
844 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
845 # define YY_STACK_PRINT(Bottom, Top)
846 # define YY_REDUCE_PRINT(Rule)
847 #endif /* !YYDEBUG */
848
849
850 /* YYINITDEPTH -- initial size of the parser's stacks. */
851 #ifndef YYINITDEPTH
852 # define YYINITDEPTH 200
853 #endif
854
855 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
856 if the built-in stack extension method is used).
857
858 Do not make this value too large; the results are undefined if
859 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
860 evaluated with infinite-precision integer arithmetic. */
861
862 #ifndef YYMAXDEPTH
863 # define YYMAXDEPTH 10000
864 #endif
865
866
867
868 #if YYERROR_VERBOSE
869
870 # ifndef yystrlen
871 # if defined __GLIBC__ && defined _STRING_H
872 # define yystrlen strlen
873 # else
874 /* Return the length of YYSTR. */
875 #if (defined __STDC__ || defined __C99__FUNC__ \
876 || defined __cplusplus || defined _MSC_VER)
877 static YYSIZE_T
878 yystrlen (const char *yystr)
879 #else
880 static YYSIZE_T
881 yystrlen (yystr)
882 const char *yystr;
883 #endif
884 {
885 YYSIZE_T yylen;
886 for (yylen = 0; yystr[yylen]; yylen++)
887 continue;
888 return yylen;
889 }
890 # endif
891 # endif
892
893 # ifndef yystpcpy
894 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
895 # define yystpcpy stpcpy
896 # else
897 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
898 YYDEST. */
899 #if (defined __STDC__ || defined __C99__FUNC__ \
900 || defined __cplusplus || defined _MSC_VER)
901 static char *
902 yystpcpy (char *yydest, const char *yysrc)
903 #else
904 static char *
905 yystpcpy (yydest, yysrc)
906 char *yydest;
907 const char *yysrc;
908 #endif
909 {
910 char *yyd = yydest;
911 const char *yys = yysrc;
912
913 while ((*yyd++ = *yys++) != '\0')
914 continue;
915
916 return yyd - 1;
917 }
918 # endif
919 # endif
920
921 # ifndef yytnamerr
922 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
923 quotes and backslashes, so that it's suitable for yyerror. The
924 heuristic is that double-quoting is unnecessary unless the string
925 contains an apostrophe, a comma, or backslash (other than
926 backslash-backslash). YYSTR is taken from yytname. If YYRES is
927 null, do not copy; instead, return the length of what the result
928 would have been. */
929 static YYSIZE_T
930 yytnamerr (char *yyres, const char *yystr)
931 {
932 if (*yystr == '"')
933 {
934 YYSIZE_T yyn = 0;
935 char const *yyp = yystr;
936
937 for (;;)
938 switch (*++yyp)
939 {
940 case '\'':
941 case ',':
942 goto do_not_strip_quotes;
943
944 case '\\':
945 if (*++yyp != '\\')
946 goto do_not_strip_quotes;
947 /* Fall through. */
948 default:
949 if (yyres)
950 yyres[yyn] = *yyp;
951 yyn++;
952 break;
953
954 case '"':
955 if (yyres)
956 yyres[yyn] = '\0';
957 return yyn;
958 }
959 do_not_strip_quotes: ;
960 }
961
962 if (! yyres)
963 return yystrlen (yystr);
964
965 return yystpcpy (yyres, yystr) - yyres;
966 }
967 # endif
968
969 /* Copy into YYRESULT an error message about the unexpected token
970 YYCHAR while in state YYSTATE. Return the number of bytes copied,
971 including the terminating null byte. If YYRESULT is null, do not
972 copy anything; just return the number of bytes that would be
973 copied. As a special case, return 0 if an ordinary "syntax error"
974 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
975 size calculation. */
976 static YYSIZE_T
977 yysyntax_error (char *yyresult, int yystate, int yychar)
978 {
979 int yyn = yypact[yystate];
980
981 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
982 return 0;
983 else
984 {
985 int yytype = YYTRANSLATE (yychar);
986 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
987 YYSIZE_T yysize = yysize0;
988 YYSIZE_T yysize1;
989 int yysize_overflow = 0;
990 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
991 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
992 int yyx;
993
994 # if 0
995 /* This is so xgettext sees the translatable formats that are
996 constructed on the fly. */
997 YY_("syntax error, unexpected %s");
998 YY_("syntax error, unexpected %s, expecting %s");
999 YY_("syntax error, unexpected %s, expecting %s or %s");
1000 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1001 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1002 # endif
1003 char *yyfmt;
1004 char const *yyf;
1005 static char const yyunexpected[] = "syntax error, unexpected %s";
1006 static char const yyexpecting[] = ", expecting %s";
1007 static char const yyor[] = " or %s";
1008 char yyformat[sizeof yyunexpected
1009 + sizeof yyexpecting - 1
1010 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1011 * (sizeof yyor - 1))];
1012 char const *yyprefix = yyexpecting;
1013
1014 /* Start YYX at -YYN if negative to avoid negative indexes in
1015 YYCHECK. */
1016 int yyxbegin = yyn < 0 ? -yyn : 0;
1017
1018 /* Stay within bounds of both yycheck and yytname. */
1019 int yychecklim = YYLAST - yyn + 1;
1020 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1021 int yycount = 1;
1022
1023 yyarg[0] = yytname[yytype];
1024 yyfmt = yystpcpy (yyformat, yyunexpected);
1025
1026 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1027 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1028 {
1029 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1030 {
1031 yycount = 1;
1032 yysize = yysize0;
1033 yyformat[sizeof yyunexpected - 1] = '\0';
1034 break;
1035 }
1036 yyarg[yycount++] = yytname[yyx];
1037 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1038 yysize_overflow |= (yysize1 < yysize);
1039 yysize = yysize1;
1040 yyfmt = yystpcpy (yyfmt, yyprefix);
1041 yyprefix = yyor;
1042 }
1043
1044 yyf = YY_(yyformat);
1045 yysize1 = yysize + yystrlen (yyf);
1046 yysize_overflow |= (yysize1 < yysize);
1047 yysize = yysize1;
1048
1049 if (yysize_overflow)
1050 return YYSIZE_MAXIMUM;
1051
1052 if (yyresult)
1053 {
1054 /* Avoid sprintf, as that infringes on the user's name space.
1055 Don't have undefined behavior even if the translation
1056 produced a string with the wrong number of "%s"s. */
1057 char *yyp = yyresult;
1058 int yyi = 0;
1059 while ((*yyp = *yyf) != '\0')
1060 {
1061 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1062 {
1063 yyp += yytnamerr (yyp, yyarg[yyi++]);
1064 yyf += 2;
1065 }
1066 else
1067 {
1068 yyp++;
1069 yyf++;
1070 }
1071 }
1072 }
1073 return yysize;
1074 }
1075 }
1076 #endif /* YYERROR_VERBOSE */
1077
1078
1079 /*-----------------------------------------------.
1080 | Release the memory associated to this symbol. |
1081 `-----------------------------------------------*/
1082
1083 /*ARGSUSED*/
1084 #if (defined __STDC__ || defined __C99__FUNC__ \
1085 || defined __cplusplus || defined _MSC_VER)
1086 static void
1087 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1088 #else
1089 static void
1090 yydestruct (yymsg, yytype, yyvaluep)
1091 const char *yymsg;
1092 int yytype;
1093 YYSTYPE *yyvaluep;
1094 #endif
1095 {
1096 YYUSE (yyvaluep);
1097
1098 if (!yymsg)
1099 yymsg = "Deleting";
1100 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1101
1102 switch (yytype)
1103 {
1104
1105 default:
1106 break;
1107 }
1108 }
1109
1110 /* Prevent warnings from -Wmissing-prototypes. */
1741111 #ifdef YYPARSE_PARAM
175 /* compatibility with FreeBSD */
176 # ifdef YYPARSE_PARAM_TYPE
177 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
1112 #if defined __STDC__ || defined __cplusplus
1113 int yyparse (void *YYPARSE_PARAM);
1114 #else
1115 int yyparse ();
1116 #endif
1117 #else /* ! YYPARSE_PARAM */
1118 #if defined __STDC__ || defined __cplusplus
1119 int yyparse (void);
1120 #else
1121 int yyparse ();
1122 #endif
1123 #endif /* ! YYPARSE_PARAM */
1124
1125
1126 /* The lookahead symbol. */
1127 int yychar;
1128
1129 /* The semantic value of the lookahead symbol. */
1130 YYSTYPE yylval;
1131
1132 /* Number of syntax errors so far. */
1133 int yynerrs;
1134
1135
1136
1137 /*-------------------------.
1138 | yyparse or yypush_parse. |
1139 `-------------------------*/
1140
1141 #ifdef YYPARSE_PARAM
1142 #if (defined __STDC__ || defined __C99__FUNC__ \
1143 || defined __cplusplus || defined _MSC_VER)
1144 int
1145 yyparse (void *YYPARSE_PARAM)
1146 #else
1147 int
1148 yyparse (YYPARSE_PARAM)
1149 void *YYPARSE_PARAM;
1150 #endif
1151 #else /* ! YYPARSE_PARAM */
1152 #if (defined __STDC__ || defined __C99__FUNC__ \
1153 || defined __cplusplus || defined _MSC_VER)
1154 int
1155 yyparse (void)
1156 #else
1157 int
1158 yyparse ()
1159
1160 #endif
1161 #endif
1162 {
1163
1164
1165 int yystate;
1166 /* Number of tokens to shift before error messages enabled. */
1167 int yyerrstatus;
1168
1169 /* The stacks and their tools:
1170 `yyss': related to states.
1171 `yyvs': related to semantic values.
1172
1173 Refer to the stacks thru separate pointers, to allow yyoverflow
1174 to reallocate them elsewhere. */
1175
1176 /* The state stack. */
1177 yytype_int16 yyssa[YYINITDEPTH];
1178 yytype_int16 *yyss;
1179 yytype_int16 *yyssp;
1180
1181 /* The semantic value stack. */
1182 YYSTYPE yyvsa[YYINITDEPTH];
1183 YYSTYPE *yyvs;
1184 YYSTYPE *yyvsp;
1185
1186 YYSIZE_T yystacksize;
1187
1188 int yyn;
1189 int yyresult;
1190 /* Lookahead token as an internal (translated) token number. */
1191 int yytoken;
1192 /* The variables used to return semantic value and location from the
1193 action routines. */
1194 YYSTYPE yyval;
1195
1196 #if YYERROR_VERBOSE
1197 /* Buffer for error messages, and its allocated size. */
1198 char yymsgbuf[128];
1199 char *yymsg = yymsgbuf;
1200 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1201 #endif
1202
1203 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1204
1205 /* The number of symbols on the RHS of the reduced rule.
1206 Keep to zero when no symbol should be popped. */
1207 int yylen = 0;
1208
1209 yytoken = 0;
1210 yyss = yyssa;
1211 yyvs = yyvsa;
1212 yystacksize = YYINITDEPTH;
1213
1214 YYDPRINTF ((stderr, "Starting parse\n"));
1215
1216 yystate = 0;
1217 yyerrstatus = 0;
1218 yynerrs = 0;
1219 yychar = YYEMPTY; /* Cause a token to be read. */
1220
1221 /* Initialize stack pointers.
1222 Waste one element of value and location stack
1223 so that they stay on the same level as the state stack.
1224 The wasted elements are never initialized. */
1225 yyssp = yyss;
1226 yyvsp = yyvs;
1227
1228 goto yysetstate;
1229
1230 /*------------------------------------------------------------.
1231 | yynewstate -- Push a new state, which is found in yystate. |
1232 `------------------------------------------------------------*/
1233 yynewstate:
1234 /* In all cases, when you get here, the value and location stacks
1235 have just been pushed. So pushing a state here evens the stacks. */
1236 yyssp++;
1237
1238 yysetstate:
1239 *yyssp = yystate;
1240
1241 if (yyss + yystacksize - 1 <= yyssp)
1242 {
1243 /* Get the current used size of the three stacks, in elements. */
1244 YYSIZE_T yysize = yyssp - yyss + 1;
1245
1246 #ifdef yyoverflow
1247 {
1248 /* Give user a chance to reallocate the stack. Use copies of
1249 these so that the &'s don't force the real ones into
1250 memory. */
1251 YYSTYPE *yyvs1 = yyvs;
1252 yytype_int16 *yyss1 = yyss;
1253
1254 /* Each stack pointer address is followed by the size of the
1255 data in use in that stack, in bytes. This used to be a
1256 conditional around just the two extra args, but that might
1257 be undefined if yyoverflow is a macro. */
1258 yyoverflow (YY_("memory exhausted"),
1259 &yyss1, yysize * sizeof (*yyssp),
1260 &yyvs1, yysize * sizeof (*yyvsp),
1261 &yystacksize);
1262
1263 yyss = yyss1;
1264 yyvs = yyvs1;
1265 }
1266 #else /* no yyoverflow */
1267 # ifndef YYSTACK_RELOCATE
1268 goto yyexhaustedlab;
1781269 # else
179 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
1270 /* Extend the stack our own way. */
1271 if (YYMAXDEPTH <= yystacksize)
1272 goto yyexhaustedlab;
1273 yystacksize *= 2;
1274 if (YYMAXDEPTH < yystacksize)
1275 yystacksize = YYMAXDEPTH;
1276
1277 {
1278 yytype_int16 *yyss1 = yyss;
1279 union yyalloc *yyptr =
1280 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1281 if (! yyptr)
1282 goto yyexhaustedlab;
1283 YYSTACK_RELOCATE (yyss_alloc, yyss);
1284 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1285 # undef YYSTACK_RELOCATE
1286 if (yyss1 != yyssa)
1287 YYSTACK_FREE (yyss1);
1288 }
1801289 # endif
181 #else
182 # define YYPARSE_DECL() yyparse(void)
183 #endif
184
185 /* Parameters sent to lex. */
186 #ifdef YYLEX_PARAM
187 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
188 # define YYLEX yylex(YYLEX_PARAM)
189 #else
190 # define YYLEX_DECL() yylex(void)
191 # define YYLEX yylex()
192 #endif
193
194 extern int YYPARSE_DECL();
195 extern int YYLEX_DECL();
196
197 #define ATOM 257
198 #define QTEXT 258
199 #define DTEXT 259
200 #define YYERRCODE 256
201 static const short addrlhs[] = { -1,
202 0, 0, 1, 3, 3, 4, 4, 6, 6, 7,
203 8, 2, 2, 5, 5, 9,
204 };
205 static const short addrlen[] = { 2,
206 1, 4, 3, 1, 3, 1, 3, 1, 1, 1,
207 3, 1, 2, 1, 1, 3,
208 };
209 static const short addrdefred[] = { 0,
210 14, 0, 0, 1, 0, 0, 0, 15, 0, 0,
211 0, 0, 13, 0, 16, 0, 0, 10, 0, 3,
212 0, 8, 9, 5, 2, 0, 0, 11, 7,
213 };
214 static const short addrdgoto[] = { 3,
215 4, 13, 6, 20, 14, 21, 22, 23, 8,
216 };
217 static const short addrsindex[] = { -33,
218 0, -252, 0, 0, -53, -56, -34, 0, -24, -33,
219 -89, -33, 0, -33, 0, -51, -31, 0, -246, 0,
220 -29, 0, 0, 0, 0, -75, -89, 0, 0,
221 };
222 static const short addrrindex[] = { 0,
223 0, 0, 0, 0, 0, 0, -55, 0, 0, 0,
224 0, 0, 0, -41, 0, 0, -44, 0, 0, 0,
225 3, 0, 0, 0, 0, 0, 0, 0, 0,
226 };
227 static const short addrgindex[] = { 0,
228 11, 22, 12, -4, 4, 0, 0, 0, 0,
229 };
230 #define YYTABLESIZE 224
231 static const short addrtable[] = { 2,
232 2, 19, 6, 7, 12, 9, 10, 11, 4, 15,
233 25, 12, 26, 17, 12, 17, 27, 28, 12, 4,
234 16, 5, 29, 24, 0, 0, 0, 0, 0, 0,
235 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
236 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
237 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
238 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
239 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
240 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
241 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
243 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
247 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
248 0, 0, 0, 0, 0, 0, 0, 18, 0, 0,
249 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
250 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
252 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
253 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
254 0, 0, 1, 1,
255 };
256 static const short addrcheck[] = { 34,
257 34, 91, 0, 0, 60, 258, 60, 64, 64, 34,
258 62, 46, 259, 10, 46, 12, 46, 93, 60, 64,
259 10, 0, 27, 12, -1, -1, -1, -1, -1, -1,
260 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
261 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
262 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
263 -1, -1, -1, -1, 62, -1, -1, -1, -1, -1,
264 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
265 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
266 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
267 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
268 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
269 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
270 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
271 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
272 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
273 -1, -1, -1, -1, -1, -1, -1, 257, -1, -1,
274 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
275 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
276 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
277 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
278 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
279 -1, -1, 257, 257,
280 };
281 #define YYFINAL 3
282 #ifndef YYDEBUG
283 #define YYDEBUG 0
284 #endif
285 #define YYMAXTOKEN 259
286 #if YYDEBUG
287 static const char *yyname[] = {
288
289 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
290 "'\"'",0,0,0,0,0,0,0,0,0,0,0,"'.'",0,0,0,0,0,0,0,0,0,0,0,0,0,"'<'",0,"'>'",0,
291 "'@'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,0,
292 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
293 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
294 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
295 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
296 "ATOM","QTEXT","DTEXT",
297 };
298 static const char *yyrule[] = {
299 "$accept : sieve_address",
300 "sieve_address : addrspec",
301 "sieve_address : phrase '<' addrspec '>'",
302 "addrspec : localpart '@' domain",
303 "localpart : word",
304 "localpart : word '.' localpart",
305 "domain : subdomain",
306 "domain : subdomain '.' domain",
307 "subdomain : domainref",
308 "subdomain : domainlit",
309 "domainref : ATOM",
310 "domainlit : '[' DTEXT ']'",
311 "phrase : word",
312 "phrase : word phrase",
313 "word : ATOM",
314 "word : qstring",
315 "qstring : '\"' QTEXT '\"'",
316
317 };
318 #endif
319 /* define the initial stack-sizes */
320 #ifdef YYSTACKSIZE
321 #undef YYMAXDEPTH
322 #define YYMAXDEPTH YYSTACKSIZE
323 #else
324 #ifdef YYMAXDEPTH
325 #define YYSTACKSIZE YYMAXDEPTH
326 #else
327 #define YYSTACKSIZE 500
328 #define YYMAXDEPTH 500
329 #endif
330 #endif
331
332 #define YYINITSTACKSIZE 500
333
334 int yydebug;
335 int yynerrs;
336
337 typedef struct {
338 unsigned stacksize;
339 short *s_base;
340 short *s_mark;
341 short *s_last;
342 YYSTYPE *l_base;
343 YYSTYPE *l_mark;
344 } YYSTACKDATA;
345 int yyerrflag;
346 int yychar;
347 YYSTYPE yyval;
348 YYSTYPE yylval;
349
350 /* variables for the parser stack */
351 static YYSTACKDATA yystack;
352 #line 112 "addr.y"
1290 #endif /* no yyoverflow */
1291
1292 yyssp = yyss + yysize - 1;
1293 yyvsp = yyvs + yysize - 1;
1294
1295 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1296 (unsigned long int) yystacksize));
1297
1298 if (yyss + yystacksize - 1 <= yyssp)
1299 YYABORT;
1300 }
1301
1302 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1303
1304 if (yystate == YYFINAL)
1305 YYACCEPT;
1306
1307 goto yybackup;
1308
1309 /*-----------.
1310 | yybackup. |
1311 `-----------*/
1312 yybackup:
1313
1314 /* Do appropriate processing given the current state. Read a
1315 lookahead token if we need one and don't already have one. */
1316
1317 /* First try to decide what to do without reference to lookahead token. */
1318 yyn = yypact[yystate];
1319 if (yyn == YYPACT_NINF)
1320 goto yydefault;
1321
1322 /* Not known => get a lookahead token if don't already have one. */
1323
1324 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1325 if (yychar == YYEMPTY)
1326 {
1327 YYDPRINTF ((stderr, "Reading a token: "));
1328 yychar = YYLEX;
1329 }
1330
1331 if (yychar <= YYEOF)
1332 {
1333 yychar = yytoken = YYEOF;
1334 YYDPRINTF ((stderr, "Now at end of input.\n"));
1335 }
1336 else
1337 {
1338 yytoken = YYTRANSLATE (yychar);
1339 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1340 }
1341
1342 /* If the proper action on seeing token YYTOKEN is to reduce or to
1343 detect an error, take that action. */
1344 yyn += yytoken;
1345 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1346 goto yydefault;
1347 yyn = yytable[yyn];
1348 if (yyn <= 0)
1349 {
1350 if (yyn == 0 || yyn == YYTABLE_NINF)
1351 goto yyerrlab;
1352 yyn = -yyn;
1353 goto yyreduce;
1354 }
1355
1356 /* Count tokens shifted since error; after three, turn off error
1357 status. */
1358 if (yyerrstatus)
1359 yyerrstatus--;
1360
1361 /* Shift the lookahead token. */
1362 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1363
1364 /* Discard the shifted token. */
1365 yychar = YYEMPTY;
1366
1367 yystate = yyn;
1368 *++yyvsp = yylval;
1369
1370 goto yynewstate;
1371
1372
1373 /*-----------------------------------------------------------.
1374 | yydefault -- do the default action for the current state. |
1375 `-----------------------------------------------------------*/
1376 yydefault:
1377 yyn = yydefact[yystate];
1378 if (yyn == 0)
1379 goto yyerrlab;
1380 goto yyreduce;
1381
1382
1383 /*-----------------------------.
1384 | yyreduce -- Do a reduction. |
1385 `-----------------------------*/
1386 yyreduce:
1387 /* yyn is the number of a rule to reduce with. */
1388 yylen = yyr2[yyn];
1389
1390 /* If YYLEN is nonzero, implement the default value of the action:
1391 `$$ = $1'.
1392
1393 Otherwise, the following line sets YYVAL to garbage.
1394 This behavior is undocumented and Bison
1395 users should not rely upon it. Assigning to YYVAL
1396 unconditionally makes the parser a bit smaller, and it avoids a
1397 GCC warning that YYVAL may be used uninitialized. */
1398 yyval = yyvsp[1-yylen];
1399
1400
1401 YY_REDUCE_PRINT (yyn);
1402 switch (yyn)
1403 {
1404
1405
1406 /* Line 1455 of yacc.c */
1407 #line 1409 "y.tab.c"
1408 default: break;
1409 }
1410 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1411
1412 YYPOPSTACK (yylen);
1413 yylen = 0;
1414 YY_STACK_PRINT (yyss, yyssp);
1415
1416 *++yyvsp = yyval;
1417
1418 /* Now `shift' the result of the reduction. Determine what state
1419 that goes to, based on the state we popped back to and the rule
1420 number reduced by. */
1421
1422 yyn = yyr1[yyn];
1423
1424 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1425 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1426 yystate = yytable[yystate];
1427 else
1428 yystate = yydefgoto[yyn - YYNTOKENS];
1429
1430 goto yynewstate;
1431
1432
1433 /*------------------------------------.
1434 | yyerrlab -- here on detecting error |
1435 `------------------------------------*/
1436 yyerrlab:
1437 /* If not already recovering from an error, report this error. */
1438 if (!yyerrstatus)
1439 {
1440 ++yynerrs;
1441 #if ! YYERROR_VERBOSE
1442 yyerror (YY_("syntax error"));
1443 #else
1444 {
1445 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1446 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1447 {
1448 YYSIZE_T yyalloc = 2 * yysize;
1449 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1450 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1451 if (yymsg != yymsgbuf)
1452 YYSTACK_FREE (yymsg);
1453 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1454 if (yymsg)
1455 yymsg_alloc = yyalloc;
1456 else
1457 {
1458 yymsg = yymsgbuf;
1459 yymsg_alloc = sizeof yymsgbuf;
1460 }
1461 }
1462
1463 if (0 < yysize && yysize <= yymsg_alloc)
1464 {
1465 (void) yysyntax_error (yymsg, yystate, yychar);
1466 yyerror (yymsg);
1467 }
1468 else
1469 {
1470 yyerror (YY_("syntax error"));
1471 if (yysize != 0)
1472 goto yyexhaustedlab;
1473 }
1474 }
1475 #endif
1476 }
1477
1478
1479
1480 if (yyerrstatus == 3)
1481 {
1482 /* If just tried and failed to reuse lookahead token after an
1483 error, discard it. */
1484
1485 if (yychar <= YYEOF)
1486 {
1487 /* Return failure if at end of input. */
1488 if (yychar == YYEOF)
1489 YYABORT;
1490 }
1491 else
1492 {
1493 yydestruct ("Error: discarding",
1494 yytoken, &yylval);
1495 yychar = YYEMPTY;
1496 }
1497 }
1498
1499 /* Else will try to reuse lookahead token after shifting the error
1500 token. */
1501 goto yyerrlab1;
1502
1503
1504 /*---------------------------------------------------.
1505 | yyerrorlab -- error raised explicitly by YYERROR. |
1506 `---------------------------------------------------*/
1507 yyerrorlab:
1508
1509 /* Pacify compilers like GCC when the user code never invokes
1510 YYERROR and the label yyerrorlab therefore never appears in user
1511 code. */
1512 if (/*CONSTCOND*/ 0)
1513 goto yyerrorlab;
1514
1515 /* Do not reclaim the symbols of the rule which action triggered
1516 this YYERROR. */
1517 YYPOPSTACK (yylen);
1518 yylen = 0;
1519 YY_STACK_PRINT (yyss, yyssp);
1520 yystate = *yyssp;
1521 goto yyerrlab1;
1522
1523
1524 /*-------------------------------------------------------------.
1525 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1526 `-------------------------------------------------------------*/
1527 yyerrlab1:
1528 yyerrstatus = 3; /* Each real token shifted decrements this. */
1529
1530 for (;;)
1531 {
1532 yyn = yypact[yystate];
1533 if (yyn != YYPACT_NINF)
1534 {
1535 yyn += YYTERROR;
1536 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1537 {
1538 yyn = yytable[yyn];
1539 if (0 < yyn)
1540 break;
1541 }
1542 }
1543
1544 /* Pop the current state because it cannot handle the error token. */
1545 if (yyssp == yyss)
1546 YYABORT;
1547
1548
1549 yydestruct ("Error: popping",
1550 yystos[yystate], yyvsp);
1551 YYPOPSTACK (1);
1552 yystate = *yyssp;
1553 YY_STACK_PRINT (yyss, yyssp);
1554 }
1555
1556 *++yyvsp = yylval;
1557
1558
1559 /* Shift the error token. */
1560 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1561
1562 yystate = yyn;
1563 goto yynewstate;
1564
1565
1566 /*-------------------------------------.
1567 | yyacceptlab -- YYACCEPT comes here. |
1568 `-------------------------------------*/
1569 yyacceptlab:
1570 yyresult = 0;
1571 goto yyreturn;
1572
1573 /*-----------------------------------.
1574 | yyabortlab -- YYABORT comes here. |
1575 `-----------------------------------*/
1576 yyabortlab:
1577 yyresult = 1;
1578 goto yyreturn;
1579
1580 #if !defined(yyoverflow) || YYERROR_VERBOSE
1581 /*-------------------------------------------------.
1582 | yyexhaustedlab -- memory exhaustion comes here. |
1583 `-------------------------------------------------*/
1584 yyexhaustedlab:
1585 yyerror (YY_("memory exhausted"));
1586 yyresult = 2;
1587 /* Fall through. */
1588 #endif
1589
1590 yyreturn:
1591 if (yychar != YYEMPTY)
1592 yydestruct ("Cleanup: discarding lookahead",
1593 yytoken, &yylval);
1594 /* Do not reclaim the symbols of the rule which action triggered
1595 this YYABORT or YYACCEPT. */
1596 YYPOPSTACK (yylen);
1597 YY_STACK_PRINT (yyss, yyssp);
1598 while (yyssp != yyss)
1599 {
1600 yydestruct ("Cleanup: popping",
1601 yystos[*yyssp], yyvsp);
1602 YYPOPSTACK (1);
1603 }
1604 #ifndef yyoverflow
1605 if (yyss != yyssa)
1606 YYSTACK_FREE (yyss);
1607 #endif
1608 #if YYERROR_VERBOSE
1609 if (yymsg != yymsgbuf)
1610 YYSTACK_FREE (yymsg);
1611 #endif
1612 /* Make sure YYID is used. */
1613 return YYID (yyresult);
1614 }
1615
1616
1617
1618 /* Line 1675 of yacc.c */
1619 #line 111 "addr.y"
1620
3531621
3541622 /* copy address error message into buffer provided by sieve parser */
3551623 int yyerror(char *s)
3591627 strlcpy(addrerr, s, ADDRERR_SIZE);
3601628 return 0;
3611629 }
362 #line 363 "y.tab.c"
363
364 #if YYDEBUG
365 #include <stdio.h> /* needed for printf */
366 #endif
367
368 #include <stdlib.h> /* needed for malloc, etc */
369 #include <string.h> /* needed for memset */
370
371 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
372 static int yygrowstack(YYSTACKDATA *data)
373 {
374 int i;
375 unsigned newsize;
376 short *newss;
377 YYSTYPE *newvs;
378
379 if ((newsize = data->stacksize) == 0)
380 newsize = YYINITSTACKSIZE;
381 else if (newsize >= YYMAXDEPTH)
382 return -1;
383 else if ((newsize *= 2) > YYMAXDEPTH)
384 newsize = YYMAXDEPTH;
385
386 i = data->s_mark - data->s_base;
387 newss = (data->s_base != 0)
388 ? (short *)realloc(data->s_base, newsize * sizeof(*newss))
389 : (short *)malloc(newsize * sizeof(*newss));
390 if (newss == 0)
391 return -1;
392
393 data->s_base = newss;
394 data->s_mark = newss + i;
395
396 newvs = (data->l_base != 0)
397 ? (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs))
398 : (YYSTYPE *)malloc(newsize * sizeof(*newvs));
399 if (newvs == 0)
400 return -1;
401
402 data->l_base = newvs;
403 data->l_mark = newvs + i;
404
405 data->stacksize = newsize;
406 data->s_last = data->s_base + newsize - 1;
407 return 0;
408 }
409
410 #if YYPURE || defined(YY_NO_LEAKS)
411 static void yyfreestack(YYSTACKDATA *data)
412 {
413 free(data->s_base);
414 free(data->l_base);
415 memset(data, 0, sizeof(*data));
416 }
417 #else
418 #define yyfreestack(data) /* nothing */
419 #endif
420
421 #define YYABORT goto yyabort
422 #define YYREJECT goto yyabort
423 #define YYACCEPT goto yyaccept
424 #define YYERROR goto yyerrlab
425
426 int
427 YYPARSE_DECL()
428 {
429 int yym, yyn, yystate;
430 #if YYDEBUG
431 const char *yys;
432
433 if ((yys = getenv("YYDEBUG")) != 0)
434 {
435 yyn = *yys;
436 if (yyn >= '0' && yyn <= '9')
437 yydebug = yyn - '0';
438 }
439 #endif
440
441 yynerrs = 0;
442 yyerrflag = 0;
443 yychar = YYEMPTY;
444 yystate = 0;
445
446 #if YYPURE
447 memset(&yystack, 0, sizeof(yystack));
448 #endif
449
450 if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
451 yystack.s_mark = yystack.s_base;
452 yystack.l_mark = yystack.l_base;
453 yystate = 0;
454 *yystack.s_mark = 0;
455
456 yyloop:
457 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
458 if (yychar < 0)
459 {
460 if ((yychar = YYLEX) < 0) yychar = 0;
461 #if YYDEBUG
462 if (yydebug)
463 {
464 yys = 0;
465 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
466 if (!yys) yys = "illegal-symbol";
467 printf("%sdebug: state %d, reading %d (%s)\n",
468 YYPREFIX, yystate, yychar, yys);
469 }
470 #endif
471 }
472 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
473 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
474 {
475 #if YYDEBUG
476 if (yydebug)
477 printf("%sdebug: state %d, shifting to state %d\n",
478 YYPREFIX, yystate, yytable[yyn]);
479 #endif
480 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
481 {
482 goto yyoverflow;
483 }
484 yystate = yytable[yyn];
485 *++yystack.s_mark = yytable[yyn];
486 *++yystack.l_mark = yylval;
487 yychar = YYEMPTY;
488 if (yyerrflag > 0) --yyerrflag;
489 goto yyloop;
490 }
491 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
492 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
493 {
494 yyn = yytable[yyn];
495 goto yyreduce;
496 }
497 if (yyerrflag) goto yyinrecovery;
498
499 yyerror("syntax error");
500
501 goto yyerrlab;
502
503 yyerrlab:
504 ++yynerrs;
505
506 yyinrecovery:
507 if (yyerrflag < 3)
508 {
509 yyerrflag = 3;
510 for (;;)
511 {
512 if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
513 yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
514 {
515 #if YYDEBUG
516 if (yydebug)
517 printf("%sdebug: state %d, error recovery shifting\
518 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
519 #endif
520 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
521 {
522 goto yyoverflow;
523 }
524 yystate = yytable[yyn];
525 *++yystack.s_mark = yytable[yyn];
526 *++yystack.l_mark = yylval;
527 goto yyloop;
528 }
529 else
530 {
531 #if YYDEBUG
532 if (yydebug)
533 printf("%sdebug: error recovery discarding state %d\n",
534 YYPREFIX, *yystack.s_mark);
535 #endif
536 if (yystack.s_mark <= yystack.s_base) goto yyabort;
537 --yystack.s_mark;
538 --yystack.l_mark;
539 }
540 }
541 }
542 else
543 {
544 if (yychar == 0) goto yyabort;
545 #if YYDEBUG
546 if (yydebug)
547 {
548 yys = 0;
549 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
550 if (!yys) yys = "illegal-symbol";
551 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
552 YYPREFIX, yystate, yychar, yys);
553 }
554 #endif
555 yychar = YYEMPTY;
556 goto yyloop;
557 }
558
559 yyreduce:
560 #if YYDEBUG
561 if (yydebug)
562 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
563 YYPREFIX, yystate, yyn, yyrule[yyn]);
564 #endif
565 yym = yylen[yyn];
566 if (yym)
567 yyval = yystack.l_mark[1-yym];
568 else
569 memset(&yyval, 0, sizeof yyval);
570 switch (yyn)
571 {
572 }
573 yystack.s_mark -= yym;
574 yystate = *yystack.s_mark;
575 yystack.l_mark -= yym;
576 yym = yylhs[yyn];
577 if (yystate == 0 && yym == 0)
578 {
579 #if YYDEBUG
580 if (yydebug)
581 printf("%sdebug: after reduction, shifting from state 0 to\
582 state %d\n", YYPREFIX, YYFINAL);
583 #endif
584 yystate = YYFINAL;
585 *++yystack.s_mark = YYFINAL;
586 *++yystack.l_mark = yyval;
587 if (yychar < 0)
588 {
589 if ((yychar = YYLEX) < 0) yychar = 0;
590 #if YYDEBUG
591 if (yydebug)
592 {
593 yys = 0;
594 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
595 if (!yys) yys = "illegal-symbol";
596 printf("%sdebug: state %d, reading %d (%s)\n",
597 YYPREFIX, YYFINAL, yychar, yys);
598 }
599 #endif
600 }
601 if (yychar == 0) goto yyaccept;
602 goto yyloop;
603 }
604 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
605 yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
606 yystate = yytable[yyn];
607 else
608 yystate = yydgoto[yym];
609 #if YYDEBUG
610 if (yydebug)
611 printf("%sdebug: after reduction, shifting from state %d \
612 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
613 #endif
614 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
615 {
616 goto yyoverflow;
617 }
618 *++yystack.s_mark = (short) yystate;
619 *++yystack.l_mark = yyval;
620 goto yyloop;
621
622 yyoverflow:
623 yyerror("yacc stack overflow");
624
625 yyabort:
626 yyfreestack(&yystack);
627 return (1);
628
629 yyaccept:
630 yyfreestack(&yystack);
631 return (0);
632 }
1630
0 #define ATOM 257
1 #define QTEXT 258
2 #define DTEXT 259
0
1 /* A Bison parser, made by GNU Bison 2.4.1. */
2
3 /* Skeleton interface for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34
35 /* Tokens. */
36 #ifndef YYTOKENTYPE
37 # define YYTOKENTYPE
38 /* Put the tokens into the symbol table, so that GDB and other debuggers
39 know about them. */
40 enum yytokentype {
41 ATOM = 258,
42 QTEXT = 259,
43 DTEXT = 260
44 };
45 #endif
46 /* Tokens. */
47 #define ATOM 258
48 #define QTEXT 259
49 #define DTEXT 260
50
51
52
53
54 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
55 typedef int YYSTYPE;
56 # define YYSTYPE_IS_TRIVIAL 1
57 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
58 # define YYSTYPE_IS_DECLARED 1
59 #endif
60
61 extern YYSTYPE addrlval;
62
63
0 #ifndef lint
1 static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
2 #endif
3
4 #define YYBYACC 1
5 #define YYMAJOR 1
6 #define YYMINOR 9
7 #define YYPATCH 20100610
8
9 #define YYEMPTY (-1)
10 #define yyclearin (yychar = YYEMPTY)
11 #define yyerrok (yyerrflag = 0)
12 #define YYRECOVERING() (yyerrflag != 0)
13
14 #define YYPREFIX "yy"
15
0
1 /* A Bison parser, made by GNU Bison 2.4.1. */
2
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
43
44 /* Identify Bison output. */
45 #define YYBISON 1
46
47 /* Bison version. */
48 #define YYBISON_VERSION "2.4.1"
49
50 /* Skeleton name. */
51 #define YYSKELETON_NAME "yacc.c"
52
53 /* Pure parsers. */
1654 #define YYPURE 0
1755
18 #line 2 "sieve.y"
56 /* Push parsers. */
57 #define YYPUSH 0
58
59 /* Pull parsers. */
60 #define YYPULL 1
61
62 /* Using locations. */
63 #define YYLSP_NEEDED 0
64
65
66
67 /* Copy the first part of user declarations. */
68
69 /* Line 189 of yacc.c */
70 #line 1 "sieve.y"
71
1972 /* sieve.y -- sieve parser
2073 * Larry Greenfield
2174 *
188241 /* byacc default is 500, bison default is 10000 - go with the
189242 larger to support big sieve scripts (see Bug #3461) */
190243 #define YYSTACKSIZE 10000
244
245
246 /* Line 189 of yacc.c */
247 #line 249 "y.tab.c"
248
249 /* Enabling traces. */
250 #ifndef YYDEBUG
251 # define YYDEBUG 0
252 #endif
253
254 /* Enabling verbose error messages. */
255 #ifdef YYERROR_VERBOSE
256 # undef YYERROR_VERBOSE
257 # define YYERROR_VERBOSE 1
258 #else
259 # define YYERROR_VERBOSE 0
260 #endif
261
262 /* Enabling the token table. */
263 #ifndef YYTOKEN_TABLE
264 # define YYTOKEN_TABLE 0
265 #endif
266
267
268 /* Tokens. */
269 #ifndef YYTOKENTYPE
270 # define YYTOKENTYPE
271 /* Put the tokens into the symbol table, so that GDB and other debuggers
272 know about them. */
273 enum yytokentype {
274 NUMBER = 258,
275 STRING = 259,
276 IF = 260,
277 ELSIF = 261,
278 ELSE = 262,
279 REJCT = 263,
280 FILEINTO = 264,
281 REDIRECT = 265,
282 KEEP = 266,
283 STOP = 267,
284 DISCARD = 268,
285 VACATION = 269,
286 REQUIRE = 270,
287 SETFLAG = 271,
288 ADDFLAG = 272,
289 REMOVEFLAG = 273,
290 MARK = 274,
291 UNMARK = 275,
292 NOTIFY = 276,
293 DENOTIFY = 277,
294 ANYOF = 278,
295 ALLOF = 279,
296 EXISTS = 280,
297 SFALSE = 281,
298 STRUE = 282,
299 HEADER = 283,
300 NOT = 284,
301 SIZE = 285,
302 ADDRESS = 286,
303 ENVELOPE = 287,
304 BODY = 288,
305 COMPARATOR = 289,
306 IS = 290,
307 CONTAINS = 291,
308 MATCHES = 292,
309 REGEX = 293,
310 COUNT = 294,
311 VALUE = 295,
312 OVER = 296,
313 UNDER = 297,
314 GT = 298,
315 GE = 299,
316 LT = 300,
317 LE = 301,
318 EQ = 302,
319 NE = 303,
320 ALL = 304,
321 LOCALPART = 305,
322 DOMAIN = 306,
323 USER = 307,
324 DETAIL = 308,
325 RAW = 309,
326 TEXT = 310,
327 CONTENT = 311,
328 DAYS = 312,
329 ADDRESSES = 313,
330 SUBJECT = 314,
331 FROM = 315,
332 HANDLE = 316,
333 MIME = 317,
334 METHOD = 318,
335 ID = 319,
336 OPTIONS = 320,
337 LOW = 321,
338 NORMAL = 322,
339 HIGH = 323,
340 ANY = 324,
341 MESSAGE = 325,
342 INCLUDE = 326,
343 PERSONAL = 327,
344 GLOBAL = 328,
345 RETURN = 329,
346 COPY = 330
347 };
348 #endif
349 /* Tokens. */
350 #define NUMBER 258
351 #define STRING 259
352 #define IF 260
353 #define ELSIF 261
354 #define ELSE 262
355 #define REJCT 263
356 #define FILEINTO 264
357 #define REDIRECT 265
358 #define KEEP 266
359 #define STOP 267
360 #define DISCARD 268
361 #define VACATION 269
362 #define REQUIRE 270
363 #define SETFLAG 271
364 #define ADDFLAG 272
365 #define REMOVEFLAG 273
366 #define MARK 274
367 #define UNMARK 275
368 #define NOTIFY 276
369 #define DENOTIFY 277
370 #define ANYOF 278
371 #define ALLOF 279
372 #define EXISTS 280
373 #define SFALSE 281
374 #define STRUE 282
375 #define HEADER 283
376 #define NOT 284
377 #define SIZE 285
378 #define ADDRESS 286
379 #define ENVELOPE 287
380 #define BODY 288
381 #define COMPARATOR 289
382 #define IS 290
383 #define CONTAINS 291
384 #define MATCHES 292
385 #define REGEX 293
386 #define COUNT 294
387 #define VALUE 295
388 #define OVER 296
389 #define UNDER 297
390 #define GT 298
391 #define GE 299
392 #define LT 300
393 #define LE 301
394 #define EQ 302
395 #define NE 303
396 #define ALL 304
397 #define LOCALPART 305
398 #define DOMAIN 306
399 #define USER 307
400 #define DETAIL 308
401 #define RAW 309
402 #define TEXT 310
403 #define CONTENT 311
404 #define DAYS 312
405 #define ADDRESSES 313
406 #define SUBJECT 314
407 #define FROM 315
408 #define HANDLE 316
409 #define MIME 317
410 #define METHOD 318
411 #define ID 319
412 #define OPTIONS 320
413 #define LOW 321
414 #define NORMAL 322
415 #define HIGH 323
416 #define ANY 324
417 #define MESSAGE 325
418 #define INCLUDE 326
419 #define PERSONAL 327
420 #define GLOBAL 328
421 #define RETURN 329
422 #define COPY 330
423
424
425
426
427 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
428 typedef union YYSTYPE
429 {
430
431 /* Line 214 of yacc.c */
191432 #line 176 "sieve.y"
192 typedef union {
433
193434 int nval;
194435 char *sval;
195436 stringlist_t *sl;
202443 struct btags *btag;
203444 struct ntags *ntag;
204445 struct dtags *dtag;
446
447
448
449 /* Line 214 of yacc.c */
450 #line 452 "y.tab.c"
205451 } YYSTYPE;
206 #line 207 "y.tab.c"
207 /* compatibility with bison */
452 # define YYSTYPE_IS_TRIVIAL 1
453 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
454 # define YYSTYPE_IS_DECLARED 1
455 #endif
456
457
458 /* Copy the second part of user declarations. */
459
460
461 /* Line 264 of yacc.c */
462 #line 464 "y.tab.c"
463
464 #ifdef short
465 # undef short
466 #endif
467
468 #ifdef YYTYPE_UINT8
469 typedef YYTYPE_UINT8 yytype_uint8;
470 #else
471 typedef unsigned char yytype_uint8;
472 #endif
473
474 #ifdef YYTYPE_INT8
475 typedef YYTYPE_INT8 yytype_int8;
476 #elif (defined __STDC__ || defined __C99__FUNC__ \
477 || defined __cplusplus || defined _MSC_VER)
478 typedef signed char yytype_int8;
479 #else
480 typedef short int yytype_int8;
481 #endif
482
483 #ifdef YYTYPE_UINT16
484 typedef YYTYPE_UINT16 yytype_uint16;
485 #else
486 typedef unsigned short int yytype_uint16;
487 #endif
488
489 #ifdef YYTYPE_INT16
490 typedef YYTYPE_INT16 yytype_int16;
491 #else
492 typedef short int yytype_int16;
493 #endif
494
495 #ifndef YYSIZE_T
496 # ifdef __SIZE_TYPE__
497 # define YYSIZE_T __SIZE_TYPE__
498 # elif defined size_t
499 # define YYSIZE_T size_t
500 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
501 || defined __cplusplus || defined _MSC_VER)
502 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
503 # define YYSIZE_T size_t
504 # else
505 # define YYSIZE_T unsigned int
506 # endif
507 #endif
508
509 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
510
511 #ifndef YY_
512 # if YYENABLE_NLS
513 # if ENABLE_NLS
514 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
515 # define YY_(msgid) dgettext ("bison-runtime", msgid)
516 # endif
517 # endif
518 # ifndef YY_
519 # define YY_(msgid) msgid
520 # endif
521 #endif
522
523 /* Suppress unused-variable warnings by "using" E. */
524 #if ! defined lint || defined __GNUC__
525 # define YYUSE(e) ((void) (e))
526 #else
527 # define YYUSE(e) /* empty */
528 #endif
529
530 /* Identity function, used to suppress warnings about constant conditions. */
531 #ifndef lint
532 # define YYID(n) (n)
533 #else
534 #if (defined __STDC__ || defined __C99__FUNC__ \
535 || defined __cplusplus || defined _MSC_VER)
536 static int
537 YYID (int yyi)
538 #else
539 static int
540 YYID (yyi)
541 int yyi;
542 #endif
543 {
544 return yyi;
545 }
546 #endif
547
548 #if ! defined yyoverflow || YYERROR_VERBOSE
549
550 /* The parser invokes alloca or malloc; define the necessary symbols. */
551
552 # ifdef YYSTACK_USE_ALLOCA
553 # if YYSTACK_USE_ALLOCA
554 # ifdef __GNUC__
555 # define YYSTACK_ALLOC __builtin_alloca
556 # elif defined __BUILTIN_VA_ARG_INCR
557 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
558 # elif defined _AIX
559 # define YYSTACK_ALLOC __alloca
560 # elif defined _MSC_VER
561 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
562 # define alloca _alloca
563 # else
564 # define YYSTACK_ALLOC alloca
565 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
566 || defined __cplusplus || defined _MSC_VER)
567 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
568 # ifndef _STDLIB_H
569 # define _STDLIB_H 1
570 # endif
571 # endif
572 # endif
573 # endif
574 # endif
575
576 # ifdef YYSTACK_ALLOC
577 /* Pacify GCC's `empty if-body' warning. */
578 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
579 # ifndef YYSTACK_ALLOC_MAXIMUM
580 /* The OS might guarantee only one guard page at the bottom of the stack,
581 and a page size can be as small as 4096 bytes. So we cannot safely
582 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
583 to allow for a few compiler-allocated temporary stack slots. */
584 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
585 # endif
586 # else
587 # define YYSTACK_ALLOC YYMALLOC
588 # define YYSTACK_FREE YYFREE
589 # ifndef YYSTACK_ALLOC_MAXIMUM
590 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
591 # endif
592 # if (defined __cplusplus && ! defined _STDLIB_H \
593 && ! ((defined YYMALLOC || defined malloc) \
594 && (defined YYFREE || defined free)))
595 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
596 # ifndef _STDLIB_H
597 # define _STDLIB_H 1
598 # endif
599 # endif
600 # ifndef YYMALLOC
601 # define YYMALLOC malloc
602 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
603 || defined __cplusplus || defined _MSC_VER)
604 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
605 # endif
606 # endif
607 # ifndef YYFREE
608 # define YYFREE free
609 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
610 || defined __cplusplus || defined _MSC_VER)
611 void free (void *); /* INFRINGES ON USER NAME SPACE */
612 # endif
613 # endif
614 # endif
615 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
616
617
618 #if (! defined yyoverflow \
619 && (! defined __cplusplus \
620 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
621
622 /* A type that is properly aligned for any stack member. */
623 union yyalloc
624 {
625 yytype_int16 yyss_alloc;
626 YYSTYPE yyvs_alloc;
627 };
628
629 /* The size of the maximum gap between one aligned stack and the next. */
630 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
631
632 /* The size of an array large to enough to hold all stacks, each with
633 N elements. */
634 # define YYSTACK_BYTES(N) \
635 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
636 + YYSTACK_GAP_MAXIMUM)
637
638 /* Copy COUNT objects from FROM to TO. The source and destination do
639 not overlap. */
640 # ifndef YYCOPY
641 # if defined __GNUC__ && 1 < __GNUC__
642 # define YYCOPY(To, From, Count) \
643 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
644 # else
645 # define YYCOPY(To, From, Count) \
646 do \
647 { \
648 YYSIZE_T yyi; \
649 for (yyi = 0; yyi < (Count); yyi++) \
650 (To)[yyi] = (From)[yyi]; \
651 } \
652 while (YYID (0))
653 # endif
654 # endif
655
656 /* Relocate STACK from its old location to the new one. The
657 local variables YYSIZE and YYSTACKSIZE give the old and new number of
658 elements in the stack, and YYPTR gives the new location of the
659 stack. Advance YYPTR to a properly aligned location for the next
660 stack. */
661 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
662 do \
663 { \
664 YYSIZE_T yynewbytes; \
665 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
666 Stack = &yyptr->Stack_alloc; \
667 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
668 yyptr += yynewbytes / sizeof (*yyptr); \
669 } \
670 while (YYID (0))
671
672 #endif
673
674 /* YYFINAL -- State number of the termination state. */
675 #define YYFINAL 8
676 /* YYLAST -- Last index in YYTABLE. */
677 #define YYLAST 248
678
679 /* YYNTOKENS -- Number of terminals. */
680 #define YYNTOKENS 84
681 /* YYNNTS -- Number of nonterminals. */
682 #define YYNNTS 28
683 /* YYNRULES -- Number of rules. */
684 #define YYNRULES 106
685 /* YYNRULES -- Number of states. */
686 #define YYNSTATES 164
687
688 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
689 #define YYUNDEFTOK 2
690 #define YYMAXUTOK 330
691
692 #define YYTRANSLATE(YYX) \
693 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
694
695 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
696 static const yytype_uint8 yytranslate[] =
697 {
698 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
700 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
701 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
702 82, 83, 2, 2, 79, 2, 2, 2, 2, 2,
703 2, 2, 2, 2, 2, 2, 2, 2, 2, 76,
704 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
705 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
706 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
707 2, 77, 2, 78, 2, 2, 2, 2, 2, 2,
708 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
709 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
710 2, 2, 2, 80, 2, 81, 2, 2, 2, 2,
711 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
712 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
713 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
714 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
715 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
716 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
717 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
718 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
719 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
720 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
721 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
722 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
723 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
724 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
725 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
726 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
727 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
728 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
729 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
730 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
731 75
732 };
733
734 #if YYDEBUG
735 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
736 YYRHS. */
737 static const yytype_uint16 yyprhs[] =
738 {
739 0, 0, 3, 5, 8, 9, 12, 16, 18, 21,
740 24, 29, 32, 33, 38, 41, 44, 48, 52, 54,
741 56, 58, 62, 65, 68, 71, 73, 75, 78, 81,
742 85, 87, 88, 90, 92, 93, 97, 101, 105, 108,
743 112, 113, 116, 120, 124, 126, 128, 130, 131, 135,
744 139, 143, 147, 151, 154, 158, 160, 162, 166, 170,
745 173, 176, 179, 182, 184, 186, 191, 196, 200, 203,
746 207, 209, 211, 213, 214, 217, 220, 224, 228, 229,
747 232, 236, 240, 241, 244, 247, 251, 254, 258, 262,
748 264, 266, 268, 270, 272, 274, 276, 278, 280, 282,
749 284, 286, 288, 289, 291, 295, 297
750 };
751
752 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
753 static const yytype_int8 yyrhs[] =
754 {
755 85, 0, -1, 86, -1, 86, 88, -1, -1, 87,
756 86, -1, 15, 97, 76, -1, 89, -1, 89, 88,
757 -1, 91, 76, -1, 5, 100, 99, 90, -1, 1,
758 76, -1, -1, 6, 100, 99, 90, -1, 7, 99,
759 -1, 8, 4, -1, 9, 109, 4, -1, 10, 109,
760 4, -1, 11, -1, 12, -1, 13, -1, 14, 96,
761 4, -1, 16, 97, -1, 17, 97, -1, 18, 97,
762 -1, 19, -1, 20, -1, 21, 93, -1, 22, 94,
763 -1, 71, 92, 4, -1, 74, -1, -1, 72, -1,
764 73, -1, -1, 93, 64, 4, -1, 93, 63, 4,
765 -1, 93, 65, 97, -1, 93, 95, -1, 93, 70,
766 4, -1, -1, 94, 95, -1, 94, 106, 4, -1,
767 94, 107, 4, -1, 66, -1, 67, -1, 68, -1,
768 -1, 96, 57, 3, -1, 96, 58, 97, -1, 96,
769 59, 4, -1, 96, 60, 4, -1, 96, 61, 4,
770 -1, 96, 62, -1, 77, 98, 78, -1, 4, -1,
771 4, -1, 98, 79, 4, -1, 80, 88, 81, -1,
772 80, 81, -1, 23, 110, -1, 24, 110, -1, 25,
773 97, -1, 26, -1, 27, -1, 28, 103, 97, 97,
774 -1, 101, 102, 97, 97, -1, 33, 104, 97, -1,
775 29, 100, -1, 30, 108, 3, -1, 1, -1, 31,
776 -1, 32, -1, -1, 102, 105, -1, 102, 106, -1,
777 102, 107, 4, -1, 102, 34, 4, -1, -1, 103,
778 106, -1, 103, 107, 4, -1, 103, 34, 4, -1,
779 -1, 104, 54, -1, 104, 55, -1, 104, 56, 97,
780 -1, 104, 106, -1, 104, 107, 4, -1, 104, 34,
781 4, -1, 49, -1, 50, -1, 51, -1, 52, -1,
782 53, -1, 35, -1, 36, -1, 37, -1, 38, -1,
783 39, -1, 40, -1, 41, -1, 42, -1, -1, 75,
784 -1, 82, 111, 83, -1, 100, -1, 100, 79, 111,
785 -1
786 };
787
788 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
789 static const yytype_uint16 yyrline[] =
790 {
791 0, 222, 222, 223, 226, 227, 230, 238, 239, 242,
792 243, 244, 247, 248, 249, 252, 261, 269, 273, 274,
793 275, 276, 285, 294, 303, 312, 317, 323, 331, 341,
794 348, 355, 356, 357, 360, 361, 364, 367, 370, 373,
795 378, 379, 382, 397, 407, 408, 409, 412, 413, 416,
796 424, 430, 436, 442, 448, 449, 452, 453, 456, 457,
797 460, 461, 462, 463, 464, 465, 489, 511, 537, 538,
798 540, 543, 544, 551, 552, 557, 561, 569, 579, 580,
799 584, 592, 602, 603, 608, 613, 621, 625, 633, 644,
800 645, 646, 647, 652, 658, 659, 660, 661, 668, 673,
801 681, 682, 685, 686, 693, 696, 697
802 };
803 #endif
804
805 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
806 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
807 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
808 static const char *const yytname[] =
809 {
810 "$end", "error", "$undefined", "NUMBER", "STRING", "IF", "ELSIF",
811 "ELSE", "REJCT", "FILEINTO", "REDIRECT", "KEEP", "STOP", "DISCARD",
812 "VACATION", "REQUIRE", "SETFLAG", "ADDFLAG", "REMOVEFLAG", "MARK",
813 "UNMARK", "NOTIFY", "DENOTIFY", "ANYOF", "ALLOF", "EXISTS", "SFALSE",
814 "STRUE", "HEADER", "NOT", "SIZE", "ADDRESS", "ENVELOPE", "BODY",
815 "COMPARATOR", "IS", "CONTAINS", "MATCHES", "REGEX", "COUNT", "VALUE",
816 "OVER", "UNDER", "GT", "GE", "LT", "LE", "EQ", "NE", "ALL", "LOCALPART",
817 "DOMAIN", "USER", "DETAIL", "RAW", "TEXT", "CONTENT", "DAYS",
818 "ADDRESSES", "SUBJECT", "FROM", "HANDLE", "MIME", "METHOD", "ID",
819 "OPTIONS", "LOW", "NORMAL", "HIGH", "ANY", "MESSAGE", "INCLUDE",
820 "PERSONAL", "GLOBAL", "RETURN", "COPY", "';'", "'['", "']'", "','",
821 "'{'", "'}'", "'('", "')'", "$accept", "start", "reqs", "require",
822 "commands", "command", "elsif", "action", "location", "ntags", "dtags",
823 "priority", "vtags", "stringlist", "strings", "block", "test",
824 "addrorenv", "aetags", "htags", "btags", "addrparttag", "comptag",
825 "relcomp", "sizetag", "copy", "testlist", "tests", 0
826 };
827 #endif
828
829 # ifdef YYPRINT
830 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
831 token YYLEX-NUM. */
832 static const yytype_uint16 yytoknum[] =
833 {
834 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
835 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
836 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
837 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
838 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
839 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
840 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
841 325, 326, 327, 328, 329, 330, 59, 91, 93, 44,
842 123, 125, 40, 41
843 };
844 # endif
845
846 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
847 static const yytype_uint8 yyr1[] =
848 {
849 0, 84, 85, 85, 86, 86, 87, 88, 88, 89,
850 89, 89, 90, 90, 90, 91, 91, 91, 91, 91,
851 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
852 91, 92, 92, 92, 93, 93, 93, 93, 93, 93,
853 94, 94, 94, 94, 95, 95, 95, 96, 96, 96,
854 96, 96, 96, 96, 97, 97, 98, 98, 99, 99,
855 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
856 100, 101, 101, 102, 102, 102, 102, 102, 103, 103,
857 103, 103, 104, 104, 104, 104, 104, 104, 104, 105,
858 105, 105, 105, 105, 106, 106, 106, 106, 107, 107,
859 108, 108, 109, 109, 110, 111, 111
860 };
861
862 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
863 static const yytype_uint8 yyr2[] =
864 {
865 0, 2, 1, 2, 0, 2, 3, 1, 2, 2,
866 4, 2, 0, 4, 2, 2, 3, 3, 1, 1,
867 1, 3, 2, 2, 2, 1, 1, 2, 2, 3,
868 1, 0, 1, 1, 0, 3, 3, 3, 2, 3,
869 0, 2, 3, 3, 1, 1, 1, 0, 3, 3,
870 3, 3, 3, 2, 3, 1, 1, 3, 3, 2,
871 2, 2, 2, 1, 1, 4, 4, 3, 2, 3,
872 1, 1, 1, 0, 2, 2, 3, 3, 0, 2,
873 3, 3, 0, 2, 2, 3, 2, 3, 3, 1,
874 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
875 1, 1, 0, 1, 3, 1, 3
876 };
877
878 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
879 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
880 means the default is an error. */
881 static const yytype_uint8 yydefact[] =
882 {
883 4, 0, 0, 0, 4, 55, 0, 0, 1, 0,
884 0, 0, 102, 102, 18, 19, 20, 47, 0, 0,
885 0, 25, 26, 34, 40, 31, 30, 3, 0, 0,
886 5, 56, 0, 6, 11, 70, 0, 0, 0, 63,
887 64, 78, 0, 0, 71, 72, 82, 0, 73, 15,
888 103, 0, 0, 0, 22, 23, 24, 27, 28, 32,
889 33, 0, 8, 9, 54, 0, 0, 60, 61, 62,
890 0, 68, 100, 101, 0, 0, 0, 12, 0, 16,
891 17, 21, 0, 0, 0, 0, 0, 53, 0, 0,
892 0, 44, 45, 46, 0, 38, 94, 95, 96, 97,
893 98, 99, 41, 0, 0, 29, 57, 105, 0, 0,
894 0, 79, 0, 69, 0, 83, 84, 0, 67, 86,
895 0, 59, 0, 0, 0, 10, 0, 89, 90, 91,
896 92, 93, 0, 74, 75, 0, 48, 49, 50, 51,
897 52, 36, 35, 37, 39, 42, 43, 0, 104, 81,
898 65, 80, 88, 85, 87, 58, 0, 14, 77, 66,
899 76, 106, 12, 13
900 };
901
902 /* YYDEFGOTO[NTERM-NUM]. */
903 static const yytype_int16 yydefgoto[] =
904 {
905 -1, 2, 3, 4, 27, 28, 125, 29, 61, 57,
906 58, 95, 53, 7, 32, 77, 107, 48, 78, 70,
907 75, 133, 103, 104, 74, 51, 67, 108
908 };
909
910 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
911 STATE-NUM. */
912 #define YYPACT_NINF -113
913 static const yytype_int16 yypact[] =
914 {
915 -4, 0, 54, 112, -4, -113, 25, -20, -113, -12,
916 215, 55, 6, 6, -113, -113, -113, -113, 0, 0,
917 0, -113, -113, -113, -113, -64, -113, -113, 5, 2,
918 -113, -113, -47, -113, -113, -113, -2, -2, 0, -113,
919 -113, -113, 215, 21, -113, -113, -113, 4, -113, -113,
920 -113, 78, 79, 85, -113, -113, -113, 3, 135, -113,
921 -113, 81, -113, -113, -113, 83, 215, -113, -113, -113,
922 160, -113, -113, -113, 87, 153, 29, 68, 101, -113,
923 -113, -113, 88, 0, 84, 89, 90, -113, 91, 92,
924 0, -113, -113, -113, 93, -113, -113, -113, -113, -113,
925 -113, -113, -113, 94, 97, -113, -113, 23, 24, 100,
926 0, -113, 102, -113, 104, -113, -113, 0, -113, -113,
927 105, -113, 30, 215, 4, -113, 111, -113, -113, -113,
928 -113, -113, 0, -113, -113, 114, -113, -113, -113, -113,
929 -113, -113, -113, -113, -113, -113, -113, 215, -113, -113,
930 -113, -113, -113, -113, -113, -113, 4, -113, -113, -113,
931 -113, -113, 68, -113
932 };
933
934 /* YYPGOTO[NTERM-NUM]. */
935 static const yytype_int16 yypgoto[] =
936 {
937 -113, -113, 115, -113, -21, -113, -35, -113, -113, -113,
938 -113, 98, -113, -18, -113, -112, -7, -113, -113, -113,
939 -113, -113, -42, -17, -113, 136, 118, 1
940 };
941
942 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
943 positive, shift that token. If negative, reduce the rule which
944 number is the opposite. If zero, do what YYDEFACT says.
945 If YYTABLE_NINF, syntax error. */
946 #define YYTABLE_NINF -8
947 static const yytype_int16 yytable[] =
948 {
949 54, 55, 56, 47, 5, -7, 9, 62, 59, 60,
950 10, 1, 157, 11, 12, 13, 14, 15, 16, 17,
951 69, 18, 19, 20, 21, 22, 23, 24, 111, 31,
952 9, 64, 65, 119, 10, 71, 134, 11, 12, 13,
953 14, 15, 16, 17, 162, 18, 19, 20, 21, 22,
954 23, 24, 110, 112, 8, 122, 33, 118, 120, 49,
955 132, 135, 72, 73, 34, 137, 88, 89, 90, 91,
956 92, 93, 143, 94, 123, 124, 25, 6, 63, 26,
957 66, 50, 79, 80, 76, 105, -7, 106, 138, 81,
958 113, 136, 150, 139, 140, 141, 142, 144, 145, 153,
959 25, 146, 147, 26, 149, 5, 151, 148, 152, 154,
960 121, 155, -2, 9, 159, 158, 156, 10, 160, 30,
961 11, 12, 13, 14, 15, 16, 17, 163, 18, 19,
962 20, 21, 22, 23, 24, 126, 96, 97, 98, 99,
963 100, 101, 82, 83, 84, 85, 86, 87, 161, 52,
964 127, 128, 129, 130, 131, 68, 102, 5, 0, 0,
965 0, 0, 0, 0, 5, 0, 0, 0, 0, 0,
966 96, 97, 98, 99, 100, 101, 0, 0, 6, 0,
967 0, 0, 0, 25, 0, 0, 26, 114, 96, 97,
968 98, 99, 100, 101, 109, 96, 97, 98, 99, 100,
969 101, 91, 92, 93, 0, 0, 0, 115, 116, 117,
970 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,
971 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
972 6, 0, 0, 0, 0, 0, 0, 6, 36, 37,
973 38, 39, 40, 41, 42, 43, 44, 45, 46
974 };
975
976 static const yytype_int16 yycheck[] =
977 {
978 18, 19, 20, 10, 4, 0, 1, 28, 72, 73,
979 5, 15, 124, 8, 9, 10, 11, 12, 13, 14,
980 38, 16, 17, 18, 19, 20, 21, 22, 70, 4,
981 1, 78, 79, 75, 5, 42, 78, 8, 9, 10,
982 11, 12, 13, 14, 156, 16, 17, 18, 19, 20,
983 21, 22, 70, 70, 0, 76, 76, 75, 75, 4,
984 78, 78, 41, 42, 76, 83, 63, 64, 65, 66,
985 67, 68, 90, 70, 6, 7, 71, 77, 76, 74,
986 82, 75, 4, 4, 80, 4, 81, 4, 4, 4,
987 3, 3, 110, 4, 4, 4, 4, 4, 4, 117,
988 71, 4, 79, 74, 4, 4, 4, 83, 4, 4,
989 81, 81, 0, 1, 132, 4, 123, 5, 4, 4,
990 8, 9, 10, 11, 12, 13, 14, 162, 16, 17,
991 18, 19, 20, 21, 22, 34, 35, 36, 37, 38,
992 39, 40, 57, 58, 59, 60, 61, 62, 147, 13,
993 49, 50, 51, 52, 53, 37, 58, 4, -1, -1,
994 -1, -1, -1, -1, 4, -1, -1, -1, -1, -1,
995 35, 36, 37, 38, 39, 40, -1, -1, 77, -1,
996 -1, -1, -1, 71, -1, -1, 74, 34, 35, 36,
997 37, 38, 39, 40, 34, 35, 36, 37, 38, 39,
998 40, 66, 67, 68, -1, -1, -1, 54, 55, 56,
999 -1, -1, -1, -1, -1, -1, 1, -1, -1, -1,
1000 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1001 77, -1, -1, -1, -1, -1, -1, 77, 23, 24,
1002 25, 26, 27, 28, 29, 30, 31, 32, 33
1003 };
1004
1005 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1006 symbol of state STATE-NUM. */
1007 static const yytype_uint8 yystos[] =
1008 {
1009 0, 15, 85, 86, 87, 4, 77, 97, 0, 1,
1010 5, 8, 9, 10, 11, 12, 13, 14, 16, 17,
1011 18, 19, 20, 21, 22, 71, 74, 88, 89, 91,
1012 86, 4, 98, 76, 76, 1, 23, 24, 25, 26,
1013 27, 28, 29, 30, 31, 32, 33, 100, 101, 4,
1014 75, 109, 109, 96, 97, 97, 97, 93, 94, 72,
1015 73, 92, 88, 76, 78, 79, 82, 110, 110, 97,
1016 103, 100, 41, 42, 108, 104, 80, 99, 102, 4,
1017 4, 4, 57, 58, 59, 60, 61, 62, 63, 64,
1018 65, 66, 67, 68, 70, 95, 35, 36, 37, 38,
1019 39, 40, 95, 106, 107, 4, 4, 100, 111, 34,
1020 97, 106, 107, 3, 34, 54, 55, 56, 97, 106,
1021 107, 81, 88, 6, 7, 90, 34, 49, 50, 51,
1022 52, 53, 97, 105, 106, 107, 3, 97, 4, 4,
1023 4, 4, 4, 97, 4, 4, 4, 79, 83, 4,
1024 97, 4, 4, 97, 4, 81, 100, 99, 4, 97,
1025 4, 111, 99, 90
1026 };
1027
1028 #define yyerrok (yyerrstatus = 0)
1029 #define yyclearin (yychar = YYEMPTY)
1030 #define YYEMPTY (-2)
1031 #define YYEOF 0
1032
1033 #define YYACCEPT goto yyacceptlab
1034 #define YYABORT goto yyabortlab
1035 #define YYERROR goto yyerrorlab
1036
1037
1038 /* Like YYERROR except do call yyerror. This remains here temporarily
1039 to ease the transition to the new meaning of YYERROR, for GCC.
1040 Once GCC version 2 has supplanted version 1, this can go. */
1041
1042 #define YYFAIL goto yyerrlab
1043
1044 #define YYRECOVERING() (!!yyerrstatus)
1045
1046 #define YYBACKUP(Token, Value) \
1047 do \
1048 if (yychar == YYEMPTY && yylen == 1) \
1049 { \
1050 yychar = (Token); \
1051 yylval = (Value); \
1052 yytoken = YYTRANSLATE (yychar); \
1053 YYPOPSTACK (1); \
1054 goto yybackup; \
1055 } \
1056 else \
1057 { \
1058 yyerror (YY_("syntax error: cannot back up")); \
1059 YYERROR; \
1060 } \
1061 while (YYID (0))
1062
1063
1064 #define YYTERROR 1
1065 #define YYERRCODE 256
1066
1067
1068 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1069 If N is 0, then set CURRENT to the empty location which ends
1070 the previous symbol: RHS[0] (always defined). */
1071
1072 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1073 #ifndef YYLLOC_DEFAULT
1074 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1075 do \
1076 if (YYID (N)) \
1077 { \
1078 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1079 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1080 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1081 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1082 } \
1083 else \
1084 { \
1085 (Current).first_line = (Current).last_line = \
1086 YYRHSLOC (Rhs, 0).last_line; \
1087 (Current).first_column = (Current).last_column = \
1088 YYRHSLOC (Rhs, 0).last_column; \
1089 } \
1090 while (YYID (0))
1091 #endif
1092
1093
1094 /* YY_LOCATION_PRINT -- Print the location on the stream.
1095 This macro was not mandated originally: define only if we know
1096 we won't break user code: when these are the locations we know. */
1097
1098 #ifndef YY_LOCATION_PRINT
1099 # if YYLTYPE_IS_TRIVIAL
1100 # define YY_LOCATION_PRINT(File, Loc) \
1101 fprintf (File, "%d.%d-%d.%d", \
1102 (Loc).first_line, (Loc).first_column, \
1103 (Loc).last_line, (Loc).last_column)
1104 # else
1105 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1106 # endif
1107 #endif
1108
1109
1110 /* YYLEX -- calling `yylex' with the right arguments. */
1111
1112 #ifdef YYLEX_PARAM
1113 # define YYLEX yylex (YYLEX_PARAM)
1114 #else
1115 # define YYLEX yylex ()
1116 #endif
1117
1118 /* Enable debugging if requested. */
1119 #if YYDEBUG
1120
1121 # ifndef YYFPRINTF
1122 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1123 # define YYFPRINTF fprintf
1124 # endif
1125
1126 # define YYDPRINTF(Args) \
1127 do { \
1128 if (yydebug) \
1129 YYFPRINTF Args; \
1130 } while (YYID (0))
1131
1132 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1133 do { \
1134 if (yydebug) \
1135 { \
1136 YYFPRINTF (stderr, "%s ", Title); \
1137 yy_symbol_print (stderr, \
1138 Type, Value); \
1139 YYFPRINTF (stderr, "\n"); \
1140 } \
1141 } while (YYID (0))
1142
1143
1144 /*--------------------------------.
1145 | Print this symbol on YYOUTPUT. |
1146 `--------------------------------*/
1147
1148 /*ARGSUSED*/
1149 #if (defined __STDC__ || defined __C99__FUNC__ \
1150 || defined __cplusplus || defined _MSC_VER)
1151 static void
1152 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1153 #else
1154 static void
1155 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1156 FILE *yyoutput;
1157 int yytype;
1158 YYSTYPE const * const yyvaluep;
1159 #endif
1160 {
1161 if (!yyvaluep)
1162 return;
1163 # ifdef YYPRINT
1164 if (yytype < YYNTOKENS)
1165 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1166 # else
1167 YYUSE (yyoutput);
1168 # endif
1169 switch (yytype)
1170 {
1171 default:
1172 break;
1173 }
1174 }
1175
1176
1177 /*--------------------------------.
1178 | Print this symbol on YYOUTPUT. |
1179 `--------------------------------*/
1180
1181 #if (defined __STDC__ || defined __C99__FUNC__ \
1182 || defined __cplusplus || defined _MSC_VER)
1183 static void
1184 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1185 #else
1186 static void
1187 yy_symbol_print (yyoutput, yytype, yyvaluep)
1188 FILE *yyoutput;
1189 int yytype;
1190 YYSTYPE const * const yyvaluep;
1191 #endif
1192 {
1193 if (yytype < YYNTOKENS)
1194 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1195 else
1196 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1197
1198 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1199 YYFPRINTF (yyoutput, ")");
1200 }
1201
1202 /*------------------------------------------------------------------.
1203 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1204 | TOP (included). |
1205 `------------------------------------------------------------------*/
1206
1207 #if (defined __STDC__ || defined __C99__FUNC__ \
1208 || defined __cplusplus || defined _MSC_VER)
1209 static void
1210 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1211 #else
1212 static void
1213 yy_stack_print (yybottom, yytop)
1214 yytype_int16 *yybottom;
1215 yytype_int16 *yytop;
1216 #endif
1217 {
1218 YYFPRINTF (stderr, "Stack now");
1219 for (; yybottom <= yytop; yybottom++)
1220 {
1221 int yybot = *yybottom;
1222 YYFPRINTF (stderr, " %d", yybot);
1223 }
1224 YYFPRINTF (stderr, "\n");
1225 }
1226
1227 # define YY_STACK_PRINT(Bottom, Top) \
1228 do { \
1229 if (yydebug) \
1230 yy_stack_print ((Bottom), (Top)); \
1231 } while (YYID (0))
1232
1233
1234 /*------------------------------------------------.
1235 | Report that the YYRULE is going to be reduced. |
1236 `------------------------------------------------*/
1237
1238 #if (defined __STDC__ || defined __C99__FUNC__ \
1239 || defined __cplusplus || defined _MSC_VER)
1240 static void
1241 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1242 #else
1243 static void
1244 yy_reduce_print (yyvsp, yyrule)
1245 YYSTYPE *yyvsp;
1246 int yyrule;
1247 #endif
1248 {
1249 int yynrhs = yyr2[yyrule];
1250 int yyi;
1251 unsigned long int yylno = yyrline[yyrule];
1252 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1253 yyrule - 1, yylno);
1254 /* The symbols being reduced. */
1255 for (yyi = 0; yyi < yynrhs; yyi++)
1256 {
1257 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1258 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1259 &(yyvsp[(yyi + 1) - (yynrhs)])
1260 );
1261 YYFPRINTF (stderr, "\n");
1262 }
1263 }
1264
1265 # define YY_REDUCE_PRINT(Rule) \
1266 do { \
1267 if (yydebug) \
1268 yy_reduce_print (yyvsp, Rule); \
1269 } while (YYID (0))
1270
1271 /* Nonzero means print parse trace. It is left uninitialized so that
1272 multiple parsers can coexist. */
1273 int yydebug;
1274 #else /* !YYDEBUG */
1275 # define YYDPRINTF(Args)
1276 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1277 # define YY_STACK_PRINT(Bottom, Top)
1278 # define YY_REDUCE_PRINT(Rule)
1279 #endif /* !YYDEBUG */
1280
1281
1282 /* YYINITDEPTH -- initial size of the parser's stacks. */
1283 #ifndef YYINITDEPTH
1284 # define YYINITDEPTH 200
1285 #endif
1286
1287 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1288 if the built-in stack extension method is used).
1289
1290 Do not make this value too large; the results are undefined if
1291 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1292 evaluated with infinite-precision integer arithmetic. */
1293
1294 #ifndef YYMAXDEPTH
1295 # define YYMAXDEPTH 10000
1296 #endif
1297
1298
1299
1300 #if YYERROR_VERBOSE
1301
1302 # ifndef yystrlen
1303 # if defined __GLIBC__ && defined _STRING_H
1304 # define yystrlen strlen
1305 # else
1306 /* Return the length of YYSTR. */
1307 #if (defined __STDC__ || defined __C99__FUNC__ \
1308 || defined __cplusplus || defined _MSC_VER)
1309 static YYSIZE_T
1310 yystrlen (const char *yystr)
1311 #else
1312 static YYSIZE_T
1313 yystrlen (yystr)
1314 const char *yystr;
1315 #endif
1316 {
1317 YYSIZE_T yylen;
1318 for (yylen = 0; yystr[yylen]; yylen++)
1319 continue;
1320 return yylen;
1321 }
1322 # endif
1323 # endif
1324
1325 # ifndef yystpcpy
1326 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1327 # define yystpcpy stpcpy
1328 # else
1329 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1330 YYDEST. */
1331 #if (defined __STDC__ || defined __C99__FUNC__ \
1332 || defined __cplusplus || defined _MSC_VER)
1333 static char *
1334 yystpcpy (char *yydest, const char *yysrc)
1335 #else
1336 static char *
1337 yystpcpy (yydest, yysrc)
1338 char *yydest;
1339 const char *yysrc;
1340 #endif
1341 {
1342 char *yyd = yydest;
1343 const char *yys = yysrc;
1344
1345 while ((*yyd++ = *yys++) != '\0')
1346 continue;
1347
1348 return yyd - 1;
1349 }
1350 # endif
1351 # endif
1352
1353 # ifndef yytnamerr
1354 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1355 quotes and backslashes, so that it's suitable for yyerror. The
1356 heuristic is that double-quoting is unnecessary unless the string
1357 contains an apostrophe, a comma, or backslash (other than
1358 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1359 null, do not copy; instead, return the length of what the result
1360 would have been. */
1361 static YYSIZE_T
1362 yytnamerr (char *yyres, const char *yystr)
1363 {
1364 if (*yystr == '"')
1365 {
1366 YYSIZE_T yyn = 0;
1367 char const *yyp = yystr;
1368
1369 for (;;)
1370 switch (*++yyp)
1371 {
1372 case '\'':
1373 case ',':
1374 goto do_not_strip_quotes;
1375
1376 case '\\':
1377 if (*++yyp != '\\')
1378 goto do_not_strip_quotes;
1379 /* Fall through. */
1380 default:
1381 if (yyres)
1382 yyres[yyn] = *yyp;
1383 yyn++;
1384 break;
1385
1386 case '"':
1387 if (yyres)
1388 yyres[yyn] = '\0';
1389 return yyn;
1390 }
1391 do_not_strip_quotes: ;
1392 }
1393
1394 if (! yyres)
1395 return yystrlen (yystr);
1396
1397 return yystpcpy (yyres, yystr) - yyres;
1398 }
1399 # endif
1400
1401 /* Copy into YYRESULT an error message about the unexpected token
1402 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1403 including the terminating null byte. If YYRESULT is null, do not
1404 copy anything; just return the number of bytes that would be
1405 copied. As a special case, return 0 if an ordinary "syntax error"
1406 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1407 size calculation. */
1408 static YYSIZE_T
1409 yysyntax_error (char *yyresult, int yystate, int yychar)
1410 {
1411 int yyn = yypact[yystate];
1412
1413 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1414 return 0;
1415 else
1416 {
1417 int yytype = YYTRANSLATE (yychar);
1418 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1419 YYSIZE_T yysize = yysize0;
1420 YYSIZE_T yysize1;
1421 int yysize_overflow = 0;
1422 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1423 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1424 int yyx;
1425
1426 # if 0
1427 /* This is so xgettext sees the translatable formats that are
1428 constructed on the fly. */
1429 YY_("syntax error, unexpected %s");
1430 YY_("syntax error, unexpected %s, expecting %s");
1431 YY_("syntax error, unexpected %s, expecting %s or %s");
1432 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1433 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1434 # endif
1435 char *yyfmt;
1436 char const *yyf;
1437 static char const yyunexpected[] = "syntax error, unexpected %s";
1438 static char const yyexpecting[] = ", expecting %s";
1439 static char const yyor[] = " or %s";
1440 char yyformat[sizeof yyunexpected
1441 + sizeof yyexpecting - 1
1442 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1443 * (sizeof yyor - 1))];
1444 char const *yyprefix = yyexpecting;
1445
1446 /* Start YYX at -YYN if negative to avoid negative indexes in
1447 YYCHECK. */
1448 int yyxbegin = yyn < 0 ? -yyn : 0;
1449
1450 /* Stay within bounds of both yycheck and yytname. */
1451 int yychecklim = YYLAST - yyn + 1;
1452 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1453 int yycount = 1;
1454
1455 yyarg[0] = yytname[yytype];
1456 yyfmt = yystpcpy (yyformat, yyunexpected);
1457
1458 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1459 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1460 {
1461 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1462 {
1463 yycount = 1;
1464 yysize = yysize0;
1465 yyformat[sizeof yyunexpected - 1] = '\0';
1466 break;
1467 }
1468 yyarg[yycount++] = yytname[yyx];
1469 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1470 yysize_overflow |= (yysize1 < yysize);
1471 yysize = yysize1;
1472 yyfmt = yystpcpy (yyfmt, yyprefix);
1473 yyprefix = yyor;
1474 }
1475
1476 yyf = YY_(yyformat);
1477 yysize1 = yysize + yystrlen (yyf);
1478 yysize_overflow |= (yysize1 < yysize);
1479 yysize = yysize1;
1480
1481 if (yysize_overflow)
1482 return YYSIZE_MAXIMUM;
1483
1484 if (yyresult)
1485 {
1486 /* Avoid sprintf, as that infringes on the user's name space.
1487 Don't have undefined behavior even if the translation
1488 produced a string with the wrong number of "%s"s. */
1489 char *yyp = yyresult;
1490 int yyi = 0;
1491 while ((*yyp = *yyf) != '\0')
1492 {
1493 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1494 {
1495 yyp += yytnamerr (yyp, yyarg[yyi++]);
1496 yyf += 2;
1497 }
1498 else
1499 {
1500 yyp++;
1501 yyf++;
1502 }
1503 }
1504 }
1505 return yysize;
1506 }
1507 }
1508 #endif /* YYERROR_VERBOSE */
1509
1510
1511 /*-----------------------------------------------.
1512 | Release the memory associated to this symbol. |
1513 `-----------------------------------------------*/
1514
1515 /*ARGSUSED*/
1516 #if (defined __STDC__ || defined __C99__FUNC__ \
1517 || defined __cplusplus || defined _MSC_VER)
1518 static void
1519 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1520 #else
1521 static void
1522 yydestruct (yymsg, yytype, yyvaluep)
1523 const char *yymsg;
1524 int yytype;
1525 YYSTYPE *yyvaluep;
1526 #endif
1527 {
1528 YYUSE (yyvaluep);
1529
1530 if (!yymsg)
1531 yymsg = "Deleting";
1532 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1533
1534 switch (yytype)
1535 {
1536
1537 default:
1538 break;
1539 }
1540 }
1541
1542 /* Prevent warnings from -Wmissing-prototypes. */
2081543 #ifdef YYPARSE_PARAM
209 /* compatibility with FreeBSD */
210 # ifdef YYPARSE_PARAM_TYPE
211 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
1544 #if defined __STDC__ || defined __cplusplus
1545 int yyparse (void *YYPARSE_PARAM);
1546 #else
1547 int yyparse ();
1548 #endif
1549 #else /* ! YYPARSE_PARAM */
1550 #if defined __STDC__ || defined __cplusplus
1551 int yyparse (void);
1552 #else
1553 int yyparse ();
1554 #endif
1555 #endif /* ! YYPARSE_PARAM */
1556
1557
1558 /* The lookahead symbol. */
1559 int yychar;
1560
1561 /* The semantic value of the lookahead symbol. */
1562 YYSTYPE yylval;
1563
1564 /* Number of syntax errors so far. */
1565 int yynerrs;
1566
1567
1568
1569 /*-------------------------.
1570 | yyparse or yypush_parse. |
1571 `-------------------------*/
1572
1573 #ifdef YYPARSE_PARAM
1574 #if (defined __STDC__ || defined __C99__FUNC__ \
1575 || defined __cplusplus || defined _MSC_VER)
1576 int
1577 yyparse (void *YYPARSE_PARAM)
1578 #else
1579 int
1580 yyparse (YYPARSE_PARAM)
1581 void *YYPARSE_PARAM;
1582 #endif
1583 #else /* ! YYPARSE_PARAM */
1584 #if (defined __STDC__ || defined __C99__FUNC__ \
1585 || defined __cplusplus || defined _MSC_VER)
1586 int
1587 yyparse (void)
1588 #else
1589 int
1590 yyparse ()
1591
1592 #endif
1593 #endif
1594 {
1595
1596
1597 int yystate;
1598 /* Number of tokens to shift before error messages enabled. */
1599 int yyerrstatus;
1600
1601 /* The stacks and their tools:
1602 `yyss': related to states.
1603 `yyvs': related to semantic values.
1604
1605 Refer to the stacks thru separate pointers, to allow yyoverflow
1606 to reallocate them elsewhere. */
1607
1608 /* The state stack. */
1609 yytype_int16 yyssa[YYINITDEPTH];
1610 yytype_int16 *yyss;
1611 yytype_int16 *yyssp;
1612
1613 /* The semantic value stack. */
1614 YYSTYPE yyvsa[YYINITDEPTH];
1615 YYSTYPE *yyvs;
1616 YYSTYPE *yyvsp;
1617
1618 YYSIZE_T yystacksize;
1619
1620 int yyn;
1621 int yyresult;
1622 /* Lookahead token as an internal (translated) token number. */
1623 int yytoken;
1624 /* The variables used to return semantic value and location from the
1625 action routines. */
1626 YYSTYPE yyval;
1627
1628 #if YYERROR_VERBOSE
1629 /* Buffer for error messages, and its allocated size. */
1630 char yymsgbuf[128];
1631 char *yymsg = yymsgbuf;
1632 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1633 #endif
1634
1635 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1636
1637 /* The number of symbols on the RHS of the reduced rule.
1638 Keep to zero when no symbol should be popped. */
1639 int yylen = 0;
1640
1641 yytoken = 0;
1642 yyss = yyssa;
1643 yyvs = yyvsa;
1644 yystacksize = YYINITDEPTH;
1645
1646 YYDPRINTF ((stderr, "Starting parse\n"));
1647
1648 yystate = 0;
1649 yyerrstatus = 0;
1650 yynerrs = 0;
1651 yychar = YYEMPTY; /* Cause a token to be read. */
1652
1653 /* Initialize stack pointers.
1654 Waste one element of value and location stack
1655 so that they stay on the same level as the state stack.
1656 The wasted elements are never initialized. */
1657 yyssp = yyss;
1658 yyvsp = yyvs;
1659
1660 goto yysetstate;
1661
1662 /*------------------------------------------------------------.
1663 | yynewstate -- Push a new state, which is found in yystate. |
1664 `------------------------------------------------------------*/
1665 yynewstate:
1666 /* In all cases, when you get here, the value and location stacks
1667 have just been pushed. So pushing a state here evens the stacks. */
1668 yyssp++;
1669
1670 yysetstate:
1671 *yyssp = yystate;
1672
1673 if (yyss + yystacksize - 1 <= yyssp)
1674 {
1675 /* Get the current used size of the three stacks, in elements. */
1676 YYSIZE_T yysize = yyssp - yyss + 1;
1677
1678 #ifdef yyoverflow
1679 {
1680 /* Give user a chance to reallocate the stack. Use copies of
1681 these so that the &'s don't force the real ones into
1682 memory. */
1683 YYSTYPE *yyvs1 = yyvs;
1684 yytype_int16 *yyss1 = yyss;
1685
1686 /* Each stack pointer address is followed by the size of the
1687 data in use in that stack, in bytes. This used to be a
1688 conditional around just the two extra args, but that might
1689 be undefined if yyoverflow is a macro. */
1690 yyoverflow (YY_("memory exhausted"),
1691 &yyss1, yysize * sizeof (*yyssp),
1692 &yyvs1, yysize * sizeof (*yyvsp),
1693 &yystacksize);
1694
1695 yyss = yyss1;
1696 yyvs = yyvs1;
1697 }
1698 #else /* no yyoverflow */
1699 # ifndef YYSTACK_RELOCATE
1700 goto yyexhaustedlab;
2121701 # else
213 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
1702 /* Extend the stack our own way. */
1703 if (YYMAXDEPTH <= yystacksize)
1704 goto yyexhaustedlab;
1705 yystacksize *= 2;
1706 if (YYMAXDEPTH < yystacksize)
1707 yystacksize = YYMAXDEPTH;
1708
1709 {
1710 yytype_int16 *yyss1 = yyss;
1711 union yyalloc *yyptr =
1712 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1713 if (! yyptr)
1714 goto yyexhaustedlab;
1715 YYSTACK_RELOCATE (yyss_alloc, yyss);
1716 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1717 # undef YYSTACK_RELOCATE
1718 if (yyss1 != yyssa)
1719 YYSTACK_FREE (yyss1);
1720 }
2141721 # endif
1722 #endif /* no yyoverflow */
1723
1724 yyssp = yyss + yysize - 1;
1725 yyvsp = yyvs + yysize - 1;
1726
1727 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1728 (unsigned long int) yystacksize));
1729
1730 if (yyss + yystacksize - 1 <= yyssp)
1731 YYABORT;
1732 }
1733
1734 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1735
1736 if (yystate == YYFINAL)
1737 YYACCEPT;
1738
1739 goto yybackup;
1740
1741 /*-----------.
1742 | yybackup. |
1743 `-----------*/
1744 yybackup:
1745
1746 /* Do appropriate processing given the current state. Read a
1747 lookahead token if we need one and don't already have one. */
1748
1749 /* First try to decide what to do without reference to lookahead token. */
1750 yyn = yypact[yystate];
1751 if (yyn == YYPACT_NINF)
1752 goto yydefault;
1753
1754 /* Not known => get a lookahead token if don't already have one. */
1755
1756 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1757 if (yychar == YYEMPTY)
1758 {
1759 YYDPRINTF ((stderr, "Reading a token: "));
1760 yychar = YYLEX;
1761 }
1762
1763 if (yychar <= YYEOF)
1764 {
1765 yychar = yytoken = YYEOF;
1766 YYDPRINTF ((stderr, "Now at end of input.\n"));
1767 }
1768 else
1769 {
1770 yytoken = YYTRANSLATE (yychar);
1771 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1772 }
1773
1774 /* If the proper action on seeing token YYTOKEN is to reduce or to
1775 detect an error, take that action. */
1776 yyn += yytoken;
1777 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1778 goto yydefault;
1779 yyn = yytable[yyn];
1780 if (yyn <= 0)
1781 {
1782 if (yyn == 0 || yyn == YYTABLE_NINF)
1783 goto yyerrlab;
1784 yyn = -yyn;
1785 goto yyreduce;
1786 }
1787
1788 /* Count tokens shifted since error; after three, turn off error
1789 status. */
1790 if (yyerrstatus)
1791 yyerrstatus--;
1792
1793 /* Shift the lookahead token. */
1794 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1795
1796 /* Discard the shifted token. */
1797 yychar = YYEMPTY;
1798
1799 yystate = yyn;
1800 *++yyvsp = yylval;
1801
1802 goto yynewstate;
1803
1804
1805 /*-----------------------------------------------------------.
1806 | yydefault -- do the default action for the current state. |
1807 `-----------------------------------------------------------*/
1808 yydefault:
1809 yyn = yydefact[yystate];
1810 if (yyn == 0)
1811 goto yyerrlab;
1812 goto yyreduce;
1813
1814
1815 /*-----------------------------.
1816 | yyreduce -- Do a reduction. |
1817 `-----------------------------*/
1818 yyreduce:
1819 /* yyn is the number of a rule to reduce with. */
1820 yylen = yyr2[yyn];
1821
1822 /* If YYLEN is nonzero, implement the default value of the action:
1823 `$$ = $1'.
1824
1825 Otherwise, the following line sets YYVAL to garbage.
1826 This behavior is undocumented and Bison
1827 users should not rely upon it. Assigning to YYVAL
1828 unconditionally makes the parser a bit smaller, and it avoids a
1829 GCC warning that YYVAL may be used uninitialized. */
1830 yyval = yyvsp[1-yylen];
1831
1832
1833 YY_REDUCE_PRINT (yyn);
1834 switch (yyn)
1835 {
1836 case 2:
1837
1838 /* Line 1455 of yacc.c */
1839 #line 222 "sieve.y"
1840 { ret = NULL; }
1841 break;
1842
1843 case 3:
1844
1845 /* Line 1455 of yacc.c */
1846 #line 223 "sieve.y"
1847 { ret = (yyvsp[(2) - (2)].cl); }
1848 break;
1849
1850 case 6:
1851
1852 /* Line 1455 of yacc.c */
1853 #line 230 "sieve.y"
1854 { char *err = check_reqs((yyvsp[(2) - (3)].sl));
1855 if (err) {
1856 yyerror(err);
1857 free(err);
1858 YYERROR;
1859 } }
1860 break;
1861
1862 case 7:
1863
1864 /* Line 1455 of yacc.c */
1865 #line 238 "sieve.y"
1866 { (yyval.cl) = (yyvsp[(1) - (1)].cl); }
1867 break;
1868
1869 case 8:
1870
1871 /* Line 1455 of yacc.c */
1872 #line 239 "sieve.y"
1873 { (yyvsp[(1) - (2)].cl)->next = (yyvsp[(2) - (2)].cl); (yyval.cl) = (yyvsp[(1) - (2)].cl); }
1874 break;
1875
1876 case 9:
1877
1878 /* Line 1455 of yacc.c */
1879 #line 242 "sieve.y"
1880 { (yyval.cl) = (yyvsp[(1) - (2)].cl); }
1881 break;
1882
1883 case 10:
1884
1885 /* Line 1455 of yacc.c */
1886 #line 243 "sieve.y"
1887 { (yyval.cl) = new_if((yyvsp[(2) - (4)].test), (yyvsp[(3) - (4)].cl), (yyvsp[(4) - (4)].cl)); }
1888 break;
1889
1890 case 11:
1891
1892 /* Line 1455 of yacc.c */
1893 #line 244 "sieve.y"
1894 { (yyval.cl) = new_command(STOP); }
1895 break;
1896
1897 case 12:
1898
1899 /* Line 1455 of yacc.c */
1900 #line 247 "sieve.y"
1901 { (yyval.cl) = NULL; }
1902 break;
1903
1904 case 13:
1905
1906 /* Line 1455 of yacc.c */
1907 #line 248 "sieve.y"
1908 { (yyval.cl) = new_if((yyvsp[(2) - (4)].test), (yyvsp[(3) - (4)].cl), (yyvsp[(4) - (4)].cl)); }
1909 break;
1910
1911 case 14:
1912
1913 /* Line 1455 of yacc.c */
1914 #line 249 "sieve.y"
1915 { (yyval.cl) = (yyvsp[(2) - (2)].cl); }
1916 break;
1917
1918 case 15:
1919
1920 /* Line 1455 of yacc.c */
1921 #line 252 "sieve.y"
1922 { if (!parse_script->support.reject) {
1923 yyerror("reject MUST be enabled with \"require\"");
1924 YYERROR;
1925 }
1926 if (!verify_utf8((yyvsp[(2) - (2)].sval))) {
1927 YYERROR; /* vu should call yyerror() */
1928 }
1929 (yyval.cl) = new_command(REJCT);
1930 (yyval.cl)->u.str = (yyvsp[(2) - (2)].sval); }
1931 break;
1932
1933 case 16:
1934
1935 /* Line 1455 of yacc.c */
1936 #line 261 "sieve.y"
1937 { if (!parse_script->support.fileinto) {
1938 yyerror("fileinto MUST be enabled with \"require\"");
1939 YYERROR;
1940 }
1941 if (!verify_mailbox((yyvsp[(3) - (3)].sval))) {
1942 YYERROR; /* vm should call yyerror() */
1943 }
1944 (yyval.cl) = build_fileinto(FILEINTO, (yyvsp[(2) - (3)].nval), (yyvsp[(3) - (3)].sval)); }
1945 break;
1946
1947 case 17:
1948
1949 /* Line 1455 of yacc.c */
1950 #line 269 "sieve.y"
1951 { if (!verify_address((yyvsp[(3) - (3)].sval))) {
1952 YYERROR; /* va should call yyerror() */
1953 }
1954 (yyval.cl) = build_redirect(REDIRECT, (yyvsp[(2) - (3)].nval), (yyvsp[(3) - (3)].sval)); }
1955 break;
1956
1957 case 18:
1958
1959 /* Line 1455 of yacc.c */
1960 #line 273 "sieve.y"
1961 { (yyval.cl) = new_command(KEEP); }
1962 break;
1963
1964 case 19:
1965
1966 /* Line 1455 of yacc.c */
1967 #line 274 "sieve.y"
1968 { (yyval.cl) = new_command(STOP); }
1969 break;
1970
1971 case 20:
1972
1973 /* Line 1455 of yacc.c */
1974 #line 275 "sieve.y"
1975 { (yyval.cl) = new_command(DISCARD); }
1976 break;
1977
1978 case 21:
1979
1980 /* Line 1455 of yacc.c */
1981 #line 276 "sieve.y"
1982 { if (!parse_script->support.vacation) {
1983 yyerror("vacation MUST be enabled with \"require\"");
1984 YYERROR;
1985 }
1986 if (((yyvsp[(2) - (3)].vtag)->mime == -1) && !verify_utf8((yyvsp[(3) - (3)].sval))) {
1987 YYERROR; /* vu should call yyerror() */
1988 }
1989 (yyval.cl) = build_vacation(VACATION,
1990 canon_vtags((yyvsp[(2) - (3)].vtag)), (yyvsp[(3) - (3)].sval)); }
1991 break;
1992
1993 case 22:
1994
1995 /* Line 1455 of yacc.c */
1996 #line 285 "sieve.y"
1997 { if (!parse_script->support.imapflags) {
1998 yyerror("imapflags MUST be enabled with \"require\"");
1999 YYERROR;
2000 }
2001 if (!verify_stringlist((yyvsp[(2) - (2)].sl), verify_flag)) {
2002 YYERROR; /* vf should call yyerror() */
2003 }
2004 (yyval.cl) = new_command(SETFLAG);
2005 (yyval.cl)->u.sl = (yyvsp[(2) - (2)].sl); }
2006 break;
2007
2008 case 23:
2009
2010 /* Line 1455 of yacc.c */
2011 #line 294 "sieve.y"
2012 { if (!parse_script->support.imapflags) {
2013 yyerror("imapflags MUST be enabled with \"require\"");
2014 YYERROR;
2015 }
2016 if (!verify_stringlist((yyvsp[(2) - (2)].sl), verify_flag)) {
2017 YYERROR; /* vf should call yyerror() */
2018 }
2019 (yyval.cl) = new_command(ADDFLAG);
2020 (yyval.cl)->u.sl = (yyvsp[(2) - (2)].sl); }
2021 break;
2022
2023 case 24:
2024
2025 /* Line 1455 of yacc.c */
2026 #line 303 "sieve.y"
2027 { if (!parse_script->support.imapflags) {
2028 yyerror("imapflags MUST be enabled with \"require\"");
2029 YYERROR;
2030 }
2031 if (!verify_stringlist((yyvsp[(2) - (2)].sl), verify_flag)) {
2032 YYERROR; /* vf should call yyerror() */
2033 }
2034 (yyval.cl) = new_command(REMOVEFLAG);
2035 (yyval.cl)->u.sl = (yyvsp[(2) - (2)].sl); }
2036 break;
2037
2038 case 25:
2039
2040 /* Line 1455 of yacc.c */
2041 #line 312 "sieve.y"
2042 { if (!parse_script->support.imapflags) {
2043 yyerror("imapflags MUST be enabled with \"require\"");
2044 YYERROR;
2045 }
2046 (yyval.cl) = new_command(MARK); }
2047 break;
2048
2049 case 26:
2050
2051 /* Line 1455 of yacc.c */
2052 #line 317 "sieve.y"
2053 { if (!parse_script->support.imapflags) {
2054 yyerror("imapflags MUST be enabled with \"require\"");
2055 YYERROR;
2056 }
2057 (yyval.cl) = new_command(UNMARK); }
2058 break;
2059
2060 case 27:
2061
2062 /* Line 1455 of yacc.c */
2063 #line 323 "sieve.y"
2064 { if (!parse_script->support.notify) {
2065 yyerror("notify MUST be enabled with \"require\"");
2066 (yyval.cl) = new_command(NOTIFY);
2067 YYERROR;
2068 } else {
2069 (yyval.cl) = build_notify(NOTIFY,
2070 canon_ntags((yyvsp[(2) - (2)].ntag)));
2071 } }
2072 break;
2073
2074 case 28:
2075
2076 /* Line 1455 of yacc.c */
2077 #line 331 "sieve.y"
2078 { if (!parse_script->support.notify) {
2079 yyerror("notify MUST be enabled with \"require\"");
2080 (yyval.cl) = new_command(DENOTIFY);
2081 YYERROR;
2082 } else {
2083 (yyval.cl) = build_denotify(DENOTIFY, canon_dtags((yyvsp[(2) - (2)].dtag)));
2084 if ((yyval.cl) == NULL) {
2085 yyerror("unable to find a compatible comparator");
2086 YYERROR; } } }
2087 break;
2088
2089 case 29:
2090
2091 /* Line 1455 of yacc.c */
2092 #line 341 "sieve.y"
2093 { if (!parse_script->support.include) {
2094 yyerror("include MUST be enabled with \"require\"");
2095 YYERROR;
2096 }
2097 (yyval.cl) = new_command(INCLUDE);
2098 (yyval.cl)->u.inc.location = (yyvsp[(2) - (3)].nval);
2099 (yyval.cl)->u.inc.script = (yyvsp[(3) - (3)].sval); }
2100 break;
2101
2102 case 30:
2103
2104 /* Line 1455 of yacc.c */
2105 #line 348 "sieve.y"
2106 { if (!parse_script->support.include) {
2107 yyerror("include MUST be enabled with \"require\"");
2108 YYERROR;
2109 }
2110 (yyval.cl) = new_command(RETURN); }
2111 break;
2112
2113 case 31:
2114
2115 /* Line 1455 of yacc.c */
2116 #line 355 "sieve.y"
2117 { (yyval.nval) = PERSONAL; }
2118 break;
2119
2120 case 32:
2121
2122 /* Line 1455 of yacc.c */
2123 #line 356 "sieve.y"
2124 { (yyval.nval) = PERSONAL; }
2125 break;
2126
2127 case 33:
2128
2129 /* Line 1455 of yacc.c */
2130 #line 357 "sieve.y"
2131 { (yyval.nval) = GLOBAL; }
2132 break;
2133
2134 case 34:
2135
2136 /* Line 1455 of yacc.c */
2137 #line 360 "sieve.y"
2138 { (yyval.ntag) = new_ntags(); }
2139 break;
2140
2141 case 35:
2142
2143 /* Line 1455 of yacc.c */
2144 #line 361 "sieve.y"
2145 { if ((yyval.ntag)->id != NULL) {
2146 yyerror("duplicate :method"); YYERROR; }
2147 else { (yyval.ntag)->id = (yyvsp[(3) - (3)].sval); } }
2148 break;
2149
2150 case 36:
2151
2152 /* Line 1455 of yacc.c */
2153 #line 364 "sieve.y"
2154 { if ((yyval.ntag)->method != NULL) {
2155 yyerror("duplicate :method"); YYERROR; }
2156 else { (yyval.ntag)->method = (yyvsp[(3) - (3)].sval); } }
2157 break;
2158
2159 case 37:
2160
2161 /* Line 1455 of yacc.c */
2162 #line 367 "sieve.y"
2163 { if ((yyval.ntag)->options != NULL) {
2164 yyerror("duplicate :options"); YYERROR; }
2165 else { (yyval.ntag)->options = (yyvsp[(3) - (3)].sl); } }
2166 break;
2167
2168 case 38:
2169
2170 /* Line 1455 of yacc.c */
2171 #line 370 "sieve.y"
2172 { if ((yyval.ntag)->priority != -1) {
2173 yyerror("duplicate :priority"); YYERROR; }
2174 else { (yyval.ntag)->priority = (yyvsp[(2) - (2)].nval); } }
2175 break;
2176
2177 case 39:
2178
2179 /* Line 1455 of yacc.c */
2180 #line 373 "sieve.y"
2181 { if ((yyval.ntag)->message != NULL) {
2182 yyerror("duplicate :message"); YYERROR; }
2183 else { (yyval.ntag)->message = (yyvsp[(3) - (3)].sval); } }
2184 break;
2185
2186 case 40:
2187
2188 /* Line 1455 of yacc.c */
2189 #line 378 "sieve.y"
2190 { (yyval.dtag) = new_dtags(); }
2191 break;
2192
2193 case 41:
2194
2195 /* Line 1455 of yacc.c */
2196 #line 379 "sieve.y"
2197 { if ((yyval.dtag)->priority != -1) {
2198 yyerror("duplicate priority level"); YYERROR; }
2199 else { (yyval.dtag)->priority = (yyvsp[(2) - (2)].nval); } }
2200 break;
2201
2202 case 42:
2203
2204 /* Line 1455 of yacc.c */
2205 #line 382 "sieve.y"
2206 { if ((yyval.dtag)->comptag != -1)
2207 {
2208 yyerror("duplicate comparator type tag"); YYERROR;
2209 }
2210 (yyval.dtag)->comptag = (yyvsp[(2) - (3)].nval);
2211 #ifdef ENABLE_REGEX
2212 if ((yyval.dtag)->comptag == REGEX)
2213 {
2214 int cflags = REG_EXTENDED |
2215 REG_NOSUB | REG_ICASE;
2216 if (!verify_regex((yyvsp[(3) - (3)].sval), cflags)) { YYERROR; }
2217 }
2218 #endif
2219 (yyval.dtag)->pattern = (yyvsp[(3) - (3)].sval);
2220 }
2221 break;
2222
2223 case 43:
2224
2225 /* Line 1455 of yacc.c */
2226 #line 397 "sieve.y"
2227 { (yyval.dtag) = (yyvsp[(1) - (3)].dtag);
2228 if ((yyval.dtag)->comptag != -1) {
2229 yyerror("duplicate comparator type tag"); YYERROR; }
2230 else { (yyval.dtag)->comptag = (yyvsp[(2) - (3)].nval);
2231 (yyval.dtag)->relation = verify_relat((yyvsp[(3) - (3)].sval));
2232 if ((yyval.dtag)->relation==-1)
2233 {YYERROR; /*vr called yyerror()*/ }
2234 } }
2235 break;
2236
2237 case 44:
2238
2239 /* Line 1455 of yacc.c */
2240 #line 407 "sieve.y"
2241 { (yyval.nval) = LOW; }
2242 break;
2243
2244 case 45:
2245
2246 /* Line 1455 of yacc.c */
2247 #line 408 "sieve.y"
2248 { (yyval.nval) = NORMAL; }
2249 break;
2250
2251 case 46:
2252
2253 /* Line 1455 of yacc.c */
2254 #line 409 "sieve.y"
2255 { (yyval.nval) = HIGH; }
2256 break;
2257
2258 case 47:
2259
2260 /* Line 1455 of yacc.c */
2261 #line 412 "sieve.y"
2262 { (yyval.vtag) = new_vtags(); }
2263 break;
2264
2265 case 48:
2266
2267 /* Line 1455 of yacc.c */
2268 #line 413 "sieve.y"
2269 { if ((yyval.vtag)->days != -1) {
2270 yyerror("duplicate :days"); YYERROR; }
2271 else { (yyval.vtag)->days = (yyvsp[(3) - (3)].nval); } }
2272 break;
2273
2274 case 49:
2275
2276 /* Line 1455 of yacc.c */
2277 #line 416 "sieve.y"
2278 { if ((yyval.vtag)->addresses != NULL) {
2279 yyerror("duplicate :addresses");
2280 YYERROR;
2281 } else if (!verify_stringlist((yyvsp[(3) - (3)].sl),
2282 verify_address)) {
2283 YYERROR;
2284 } else {
2285 (yyval.vtag)->addresses = (yyvsp[(3) - (3)].sl); } }
2286 break;
2287
2288 case 50:
2289
2290 /* Line 1455 of yacc.c */
2291 #line 424 "sieve.y"
2292 { if ((yyval.vtag)->subject != NULL) {
2293 yyerror("duplicate :subject");
2294 YYERROR;
2295 } else if (!verify_utf8((yyvsp[(3) - (3)].sval))) {
2296 YYERROR; /* vu should call yyerror() */
2297 } else { (yyval.vtag)->subject = (yyvsp[(3) - (3)].sval); } }
2298 break;
2299
2300 case 51:
2301
2302 /* Line 1455 of yacc.c */
2303 #line 430 "sieve.y"
2304 { if ((yyval.vtag)->from != NULL) {
2305 yyerror("duplicate :from");
2306 YYERROR;
2307 } else if (!verify_address((yyvsp[(3) - (3)].sval))) {
2308 YYERROR; /* vu should call yyerror() */
2309 } else { (yyval.vtag)->from = (yyvsp[(3) - (3)].sval); } }
2310 break;
2311
2312 case 52:
2313
2314 /* Line 1455 of yacc.c */
2315 #line 436 "sieve.y"
2316 { if ((yyval.vtag)->handle != NULL) {
2317 yyerror("duplicate :handle");
2318 YYERROR;
2319 } else if (!verify_utf8((yyvsp[(3) - (3)].sval))) {
2320 YYERROR; /* vu should call yyerror() */
2321 } else { (yyval.vtag)->handle = (yyvsp[(3) - (3)].sval); } }
2322 break;
2323
2324 case 53:
2325
2326 /* Line 1455 of yacc.c */
2327 #line 442 "sieve.y"
2328 { if ((yyval.vtag)->mime != -1) {
2329 yyerror("duplicate :mime");
2330 YYERROR; }
2331 else { (yyval.vtag)->mime = MIME; } }
2332 break;
2333
2334 case 54:
2335
2336 /* Line 1455 of yacc.c */
2337 #line 448 "sieve.y"
2338 { (yyval.sl) = sl_reverse((yyvsp[(2) - (3)].sl)); }
2339 break;
2340
2341 case 55:
2342
2343 /* Line 1455 of yacc.c */
2344 #line 449 "sieve.y"
2345 { (yyval.sl) = new_sl((yyvsp[(1) - (1)].sval), NULL); }
2346 break;
2347
2348 case 56:
2349
2350 /* Line 1455 of yacc.c */
2351 #line 452 "sieve.y"
2352 { (yyval.sl) = new_sl((yyvsp[(1) - (1)].sval), NULL); }
2353 break;
2354
2355 case 57:
2356
2357 /* Line 1455 of yacc.c */
2358 #line 453 "sieve.y"
2359 { (yyval.sl) = new_sl((yyvsp[(3) - (3)].sval), (yyvsp[(1) - (3)].sl)); }
2360 break;
2361
2362 case 58:
2363
2364 /* Line 1455 of yacc.c */
2365 #line 456 "sieve.y"
2366 { (yyval.cl) = (yyvsp[(2) - (3)].cl); }
2367 break;
2368
2369 case 59:
2370
2371 /* Line 1455 of yacc.c */
2372 #line 457 "sieve.y"
2373 { (yyval.cl) = NULL; }
2374 break;
2375
2376 case 60:
2377
2378 /* Line 1455 of yacc.c */
2379 #line 460 "sieve.y"
2380 { (yyval.test) = new_test(ANYOF); (yyval.test)->u.tl = (yyvsp[(2) - (2)].testl); }
2381 break;
2382
2383 case 61:
2384
2385 /* Line 1455 of yacc.c */
2386 #line 461 "sieve.y"
2387 { (yyval.test) = new_test(ALLOF); (yyval.test)->u.tl = (yyvsp[(2) - (2)].testl); }
2388 break;
2389
2390 case 62:
2391
2392 /* Line 1455 of yacc.c */
2393 #line 462 "sieve.y"
2394 { (yyval.test) = new_test(EXISTS); (yyval.test)->u.sl = (yyvsp[(2) - (2)].sl); }
2395 break;
2396
2397 case 63:
2398
2399 /* Line 1455 of yacc.c */
2400 #line 463 "sieve.y"
2401 { (yyval.test) = new_test(SFALSE); }
2402 break;
2403
2404 case 64:
2405
2406 /* Line 1455 of yacc.c */
2407 #line 464 "sieve.y"
2408 { (yyval.test) = new_test(STRUE); }
2409 break;
2410
2411 case 65:
2412
2413 /* Line 1455 of yacc.c */
2414 #line 466 "sieve.y"
2415 {
2416 if (!verify_stringlist((yyvsp[(3) - (4)].sl), verify_header)) {
2417 YYERROR; /* vh should call yyerror() */
2418 }
2419 if (!verify_stringlist((yyvsp[(4) - (4)].sl), verify_utf8)) {
2420 YYERROR; /* vu should call yyerror() */
2421 }
2422
2423 (yyvsp[(2) - (4)].htag) = canon_htags((yyvsp[(2) - (4)].htag));
2424 #ifdef ENABLE_REGEX
2425 if ((yyvsp[(2) - (4)].htag)->comptag == REGEX)
2426 {
2427 if (!(verify_regexs((yyvsp[(4) - (4)].sl), (yyvsp[(2) - (4)].htag)->comparator)))
2428 { YYERROR; }
2429 }
2430 #endif
2431 (yyval.test) = build_header(HEADER, (yyvsp[(2) - (4)].htag), (yyvsp[(3) - (4)].sl), (yyvsp[(4) - (4)].sl));
2432 if ((yyval.test) == NULL) {
2433 yyerror("unable to find a compatible comparator");
2434 YYERROR; }
2435 }
2436 break;
2437
2438 case 66:
2439
2440 /* Line 1455 of yacc.c */
2441 #line 490 "sieve.y"
2442 {
2443 if (((yyvsp[(1) - (4)].nval) == ADDRESS) &&
2444 !verify_stringlist((yyvsp[(3) - (4)].sl), verify_addrheader))
2445 { YYERROR; }
2446 else if (((yyvsp[(1) - (4)].nval) == ENVELOPE) &&
2447 !verify_stringlist((yyvsp[(3) - (4)].sl), verify_envelope))
2448 { YYERROR; }
2449 (yyvsp[(2) - (4)].aetag) = canon_aetags((yyvsp[(2) - (4)].aetag));
2450 #ifdef ENABLE_REGEX
2451 if ((yyvsp[(2) - (4)].aetag)->comptag == REGEX)
2452 {
2453 if (!( verify_regexs((yyvsp[(4) - (4)].sl), (yyvsp[(2) - (4)].aetag)->comparator)))
2454 { YYERROR; }
2455 }
2456 #endif
2457 (yyval.test) = build_address((yyvsp[(1) - (4)].nval), (yyvsp[(2) - (4)].aetag), (yyvsp[(3) - (4)].sl), (yyvsp[(4) - (4)].sl));
2458 if ((yyval.test) == NULL) {
2459 yyerror("unable to find a compatible comparator");
2460 YYERROR; }
2461 }
2462 break;
2463
2464 case 67:
2465
2466 /* Line 1455 of yacc.c */
2467 #line 512 "sieve.y"
2468 {
2469 if (!parse_script->support.body) {
2470 yyerror("body MUST be enabled with \"require\"");
2471 YYERROR;
2472 }
2473
2474 if (!verify_stringlist((yyvsp[(3) - (3)].sl), verify_utf8)) {
2475 YYERROR; /* vu should call yyerror() */
2476 }
2477
2478 (yyvsp[(2) - (3)].btag) = canon_btags((yyvsp[(2) - (3)].btag));
2479 #ifdef ENABLE_REGEX
2480 if ((yyvsp[(2) - (3)].btag)->comptag == REGEX)
2481 {
2482 if (!(verify_regexs((yyvsp[(3) - (3)].sl), (yyvsp[(2) - (3)].btag)->comparator)))
2483 { YYERROR; }
2484 }
2485 #endif
2486 (yyval.test) = build_body(BODY, (yyvsp[(2) - (3)].btag), (yyvsp[(3) - (3)].sl));
2487 if ((yyval.test) == NULL) {
2488 yyerror("unable to find a compatible comparator");
2489 YYERROR; }
2490 }
2491 break;
2492
2493 case 68:
2494
2495 /* Line 1455 of yacc.c */
2496 #line 537 "sieve.y"
2497 { (yyval.test) = new_test(NOT); (yyval.test)->u.t = (yyvsp[(2) - (2)].test); }
2498 break;
2499
2500 case 69:
2501
2502 /* Line 1455 of yacc.c */
2503 #line 538 "sieve.y"
2504 { (yyval.test) = new_test(SIZE); (yyval.test)->u.sz.t = (yyvsp[(2) - (3)].nval);
2505 (yyval.test)->u.sz.n = (yyvsp[(3) - (3)].nval); }
2506 break;
2507
2508 case 70:
2509
2510 /* Line 1455 of yacc.c */
2511 #line 540 "sieve.y"
2512 { (yyval.test) = NULL; }
2513 break;
2514
2515 case 71:
2516
2517 /* Line 1455 of yacc.c */
2518 #line 543 "sieve.y"
2519 { (yyval.nval) = ADDRESS; }
2520 break;
2521
2522 case 72:
2523
2524 /* Line 1455 of yacc.c */
2525 #line 544 "sieve.y"
2526 {if (!parse_script->support.envelope)
2527 {yyerror("envelope MUST be enabled with \"require\""); YYERROR;}
2528 else{(yyval.nval) = ENVELOPE; }
2529 }
2530 break;
2531
2532 case 73:
2533
2534 /* Line 1455 of yacc.c */
2535 #line 551 "sieve.y"
2536 { (yyval.aetag) = new_aetags(); }
2537 break;
2538
2539 case 74:
2540
2541 /* Line 1455 of yacc.c */
2542 #line 552 "sieve.y"
2543 { (yyval.aetag) = (yyvsp[(1) - (2)].aetag);
2544 if ((yyval.aetag)->addrtag != -1) {
2545 yyerror("duplicate or conflicting address part tag");
2546 YYERROR; }
2547 else { (yyval.aetag)->addrtag = (yyvsp[(2) - (2)].nval); } }
2548 break;
2549
2550 case 75:
2551
2552 /* Line 1455 of yacc.c */
2553 #line 557 "sieve.y"
2554 { (yyval.aetag) = (yyvsp[(1) - (2)].aetag);
2555 if ((yyval.aetag)->comptag != -1) {
2556 yyerror("duplicate comparator type tag"); YYERROR; }
2557 else { (yyval.aetag)->comptag = (yyvsp[(2) - (2)].nval); } }
2558 break;
2559
2560 case 76:
2561
2562 /* Line 1455 of yacc.c */
2563 #line 561 "sieve.y"
2564 { (yyval.aetag) = (yyvsp[(1) - (3)].aetag);
2565 if ((yyval.aetag)->comptag != -1) {
2566 yyerror("duplicate comparator type tag"); YYERROR; }
2567 else { (yyval.aetag)->comptag = (yyvsp[(2) - (3)].nval);
2568 (yyval.aetag)->relation = verify_relat((yyvsp[(3) - (3)].sval));
2569 if ((yyval.aetag)->relation==-1)
2570 {YYERROR; /*vr called yyerror()*/ }
2571 } }
2572 break;
2573
2574 case 77:
2575
2576 /* Line 1455 of yacc.c */
2577 #line 569 "sieve.y"
2578 { (yyval.aetag) = (yyvsp[(1) - (3)].aetag);
2579 if ((yyval.aetag)->comparator != NULL) {
2580 yyerror("duplicate comparator tag"); YYERROR; }
2581 else if (!strcmp((yyvsp[(3) - (3)].sval), "i;ascii-numeric") &&
2582 !parse_script->support.i_ascii_numeric) {
2583 yyerror("comparator-i;ascii-numeric MUST be enabled with \"require\"");
2584 YYERROR; }
2585 else { (yyval.aetag)->comparator = (yyvsp[(3) - (3)].sval); } }
2586 break;
2587
2588 case 78:
2589
2590 /* Line 1455 of yacc.c */
2591 #line 579 "sieve.y"
2592 { (yyval.htag) = new_htags(); }
2593 break;
2594
2595 case 79:
2596
2597 /* Line 1455 of yacc.c */
2598 #line 580 "sieve.y"
2599 { (yyval.htag) = (yyvsp[(1) - (2)].htag);
2600 if ((yyval.htag)->comptag != -1) {
2601 yyerror("duplicate comparator type tag"); YYERROR; }
2602 else { (yyval.htag)->comptag = (yyvsp[(2) - (2)].nval); } }
2603 break;
2604
2605 case 80:
2606
2607 /* Line 1455 of yacc.c */
2608 #line 584 "sieve.y"
2609 { (yyval.htag) = (yyvsp[(1) - (3)].htag);
2610 if ((yyval.htag)->comptag != -1) {
2611 yyerror("duplicate comparator type tag"); YYERROR; }
2612 else { (yyval.htag)->comptag = (yyvsp[(2) - (3)].nval);
2613 (yyval.htag)->relation = verify_relat((yyvsp[(3) - (3)].sval));
2614 if ((yyval.htag)->relation==-1)
2615 {YYERROR; /*vr called yyerror()*/ }
2616 } }
2617 break;
2618
2619 case 81:
2620
2621 /* Line 1455 of yacc.c */
2622 #line 592 "sieve.y"
2623 { (yyval.htag) = (yyvsp[(1) - (3)].htag);
2624 if ((yyval.htag)->comparator != NULL) {
2625 yyerror("duplicate comparator tag"); YYERROR; }
2626 else if (!strcmp((yyvsp[(3) - (3)].sval), "i;ascii-numeric") &&
2627 !parse_script->support.i_ascii_numeric) {
2628 yyerror("comparator-i;ascii-numeric MUST be enabled with \"require\""); YYERROR; }
2629 else {
2630 (yyval.htag)->comparator = (yyvsp[(3) - (3)].sval); } }
2631 break;
2632
2633 case 82:
2634
2635 /* Line 1455 of yacc.c */
2636 #line 602 "sieve.y"
2637 { (yyval.btag) = new_btags(); }
2638 break;
2639
2640 case 83:
2641
2642 /* Line 1455 of yacc.c */
2643 #line 603 "sieve.y"
2644 { (yyval.btag) = (yyvsp[(1) - (2)].btag);
2645 if ((yyval.btag)->transform != -1) {
2646 yyerror("duplicate or conflicting transform tag");
2647 YYERROR; }
2648 else { (yyval.btag)->transform = RAW; } }
2649 break;
2650
2651 case 84:
2652
2653 /* Line 1455 of yacc.c */
2654 #line 608 "sieve.y"
2655 { (yyval.btag) = (yyvsp[(1) - (2)].btag);
2656 if ((yyval.btag)->transform != -1) {
2657 yyerror("duplicate or conflicting transform tag");
2658 YYERROR; }
2659 else { (yyval.btag)->transform = TEXT; } }
2660 break;
2661
2662 case 85:
2663
2664 /* Line 1455 of yacc.c */
2665 #line 613 "sieve.y"
2666 { (yyval.btag) = (yyvsp[(1) - (3)].btag);
2667 if ((yyval.btag)->transform != -1) {
2668 yyerror("duplicate or conflicting transform tag");
2669 YYERROR; }
2670 else {
2671 (yyval.btag)->transform = CONTENT;
2672 (yyval.btag)->content_types = (yyvsp[(3) - (3)].sl);
2673 } }
2674 break;
2675
2676 case 86:
2677
2678 /* Line 1455 of yacc.c */
2679 #line 621 "sieve.y"
2680 { (yyval.btag) = (yyvsp[(1) - (2)].btag);
2681 if ((yyval.btag)->comptag != -1) {
2682 yyerror("duplicate comparator type tag"); YYERROR; }
2683 else { (yyval.btag)->comptag = (yyvsp[(2) - (2)].nval); } }
2684 break;
2685
2686 case 87:
2687
2688 /* Line 1455 of yacc.c */
2689 #line 625 "sieve.y"
2690 { (yyval.btag) = (yyvsp[(1) - (3)].btag);
2691 if ((yyval.btag)->comptag != -1) {
2692 yyerror("duplicate comparator type tag"); YYERROR; }
2693 else { (yyval.btag)->comptag = (yyvsp[(2) - (3)].nval);
2694 (yyval.btag)->relation = verify_relat((yyvsp[(3) - (3)].sval));
2695 if ((yyval.btag)->relation==-1)
2696 {YYERROR; /*vr called yyerror()*/ }
2697 } }
2698 break;
2699
2700 case 88:
2701
2702 /* Line 1455 of yacc.c */
2703 #line 633 "sieve.y"
2704 { (yyval.btag) = (yyvsp[(1) - (3)].btag);
2705 if ((yyval.btag)->comparator != NULL) {
2706 yyerror("duplicate comparator tag"); YYERROR; }
2707 else if (!strcmp((yyvsp[(3) - (3)].sval), "i;ascii-numeric") &&
2708 !parse_script->support.i_ascii_numeric) {
2709 yyerror("comparator-i;ascii-numeric MUST be enabled with \"require\""); YYERROR; }
2710 else {
2711 (yyval.btag)->comparator = (yyvsp[(3) - (3)].sval); } }
2712 break;
2713
2714 case 89:
2715
2716 /* Line 1455 of yacc.c */
2717 #line 644 "sieve.y"
2718 { (yyval.nval) = ALL; }
2719 break;
2720
2721 case 90:
2722
2723 /* Line 1455 of yacc.c */
2724 #line 645 "sieve.y"
2725 { (yyval.nval) = LOCALPART; }
2726 break;
2727
2728 case 91:
2729
2730 /* Line 1455 of yacc.c */
2731 #line 646 "sieve.y"
2732 { (yyval.nval) = DOMAIN; }
2733 break;
2734
2735 case 92:
2736
2737 /* Line 1455 of yacc.c */
2738 #line 647 "sieve.y"
2739 { if (!parse_script->support.subaddress) {
2740 yyerror("subaddress MUST be enabled with \"require\"");
2741 YYERROR;
2742 }
2743 (yyval.nval) = USER; }
2744 break;
2745
2746 case 93:
2747
2748 /* Line 1455 of yacc.c */
2749 #line 652 "sieve.y"
2750 { if (!parse_script->support.subaddress) {
2751 yyerror("subaddress MUST be enabled with \"require\"");
2752 YYERROR;
2753 }
2754 (yyval.nval) = DETAIL; }
2755 break;
2756
2757 case 94:
2758
2759 /* Line 1455 of yacc.c */
2760 #line 658 "sieve.y"
2761 { (yyval.nval) = IS; }
2762 break;
2763
2764 case 95:
2765
2766 /* Line 1455 of yacc.c */
2767 #line 659 "sieve.y"
2768 { (yyval.nval) = CONTAINS; }
2769 break;
2770
2771 case 96:
2772
2773 /* Line 1455 of yacc.c */
2774 #line 660 "sieve.y"
2775 { (yyval.nval) = MATCHES; }
2776 break;
2777
2778 case 97:
2779
2780 /* Line 1455 of yacc.c */
2781 #line 661 "sieve.y"
2782 { if (!parse_script->support.regex) {
2783 yyerror("regex MUST be enabled with \"require\"");
2784 YYERROR;
2785 }
2786 (yyval.nval) = REGEX; }
2787 break;
2788
2789 case 98:
2790
2791 /* Line 1455 of yacc.c */
2792 #line 668 "sieve.y"
2793 { if (!parse_script->support.relational) {
2794 yyerror("relational MUST be enabled with \"require\"");
2795 YYERROR;
2796 }
2797 (yyval.nval) = COUNT; }
2798 break;
2799
2800 case 99:
2801
2802 /* Line 1455 of yacc.c */
2803 #line 673 "sieve.y"
2804 { if (!parse_script->support.relational) {
2805 yyerror("relational MUST be enabled with \"require\"");
2806 YYERROR;
2807 }
2808 (yyval.nval) = VALUE; }
2809 break;
2810
2811 case 100:
2812
2813 /* Line 1455 of yacc.c */
2814 #line 681 "sieve.y"
2815 { (yyval.nval) = OVER; }
2816 break;
2817
2818 case 101:
2819
2820 /* Line 1455 of yacc.c */
2821 #line 682 "sieve.y"
2822 { (yyval.nval) = UNDER; }
2823 break;
2824
2825 case 102:
2826
2827 /* Line 1455 of yacc.c */
2828 #line 685 "sieve.y"
2829 { (yyval.nval) = 0; }
2830 break;
2831
2832 case 103:
2833
2834 /* Line 1455 of yacc.c */
2835 #line 686 "sieve.y"
2836 { if (!parse_script->support.copy) {
2837 yyerror("copy MUST be enabled with \"require\"");
2838 YYERROR;
2839 }
2840 (yyval.nval) = COPY; }
2841 break;
2842
2843 case 104:
2844
2845 /* Line 1455 of yacc.c */
2846 #line 693 "sieve.y"
2847 { (yyval.testl) = (yyvsp[(2) - (3)].testl); }
2848 break;
2849
2850 case 105:
2851
2852 /* Line 1455 of yacc.c */
2853 #line 696 "sieve.y"
2854 { (yyval.testl) = new_testlist((yyvsp[(1) - (1)].test), NULL); }
2855 break;
2856
2857 case 106:
2858
2859 /* Line 1455 of yacc.c */
2860 #line 697 "sieve.y"
2861 { (yyval.testl) = new_testlist((yyvsp[(1) - (3)].test), (yyvsp[(3) - (3)].testl)); }
2862 break;
2863
2864
2865
2866 /* Line 1455 of yacc.c */
2867 #line 2869 "y.tab.c"
2868 default: break;
2869 }
2870 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2871
2872 YYPOPSTACK (yylen);
2873 yylen = 0;
2874 YY_STACK_PRINT (yyss, yyssp);
2875
2876 *++yyvsp = yyval;
2877
2878 /* Now `shift' the result of the reduction. Determine what state
2879 that goes to, based on the state we popped back to and the rule
2880 number reduced by. */
2881
2882 yyn = yyr1[yyn];
2883
2884 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2885 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2886 yystate = yytable[yystate];
2887 else
2888 yystate = yydefgoto[yyn - YYNTOKENS];
2889
2890 goto yynewstate;
2891
2892
2893 /*------------------------------------.
2894 | yyerrlab -- here on detecting error |
2895 `------------------------------------*/
2896 yyerrlab:
2897 /* If not already recovering from an error, report this error. */
2898 if (!yyerrstatus)
2899 {
2900 ++yynerrs;
2901 #if ! YYERROR_VERBOSE
2902 yyerror (YY_("syntax error"));
2152903 #else
216 # define YYPARSE_DECL() yyparse(void)
217 #endif
218
219 /* Parameters sent to lex. */
220 #ifdef YYLEX_PARAM
221 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
222 # define YYLEX yylex(YYLEX_PARAM)
223 #else
224 # define YYLEX_DECL() yylex(void)
225 # define YYLEX yylex()
226 #endif
227
228 extern int YYPARSE_DECL();
229 extern int YYLEX_DECL();
230
231 #define NUMBER 257
232 #define STRING 258
233 #define IF 259
234 #define ELSIF 260
235 #define ELSE 261
236 #define REJCT 262
237 #define FILEINTO 263
238 #define REDIRECT 264
239 #define KEEP 265
240 #define STOP 266
241 #define DISCARD 267
242 #define VACATION 268
243 #define REQUIRE 269
244 #define SETFLAG 270
245 #define ADDFLAG 271
246 #define REMOVEFLAG 272
247 #define MARK 273
248 #define UNMARK 274
249 #define NOTIFY 275
250 #define DENOTIFY 276
251 #define ANYOF 277
252 #define ALLOF 278
253 #define EXISTS 279
254 #define SFALSE 280
255 #define STRUE 281
256 #define HEADER 282
257 #define NOT 283
258 #define SIZE 284
259 #define ADDRESS 285
260 #define ENVELOPE 286
261 #define BODY 287
262 #define COMPARATOR 288
263 #define IS 289
264 #define CONTAINS 290
265 #define MATCHES 291
266 #define REGEX 292
267 #define COUNT 293
268 #define VALUE 294
269 #define OVER 295
270 #define UNDER 296
271 #define GT 297
272 #define GE 298
273 #define LT 299
274 #define LE 300
275 #define EQ 301
276 #define NE 302
277 #define ALL 303
278 #define LOCALPART 304
279 #define DOMAIN 305
280 #define USER 306
281 #define DETAIL 307
282 #define RAW 308
283 #define TEXT 309
284 #define CONTENT 310
285 #define DAYS 311
286 #define ADDRESSES 312
287 #define SUBJECT 313
288 #define FROM 314
289 #define HANDLE 315
290 #define MIME 316
291 #define METHOD 317
292 #define ID 318
293 #define OPTIONS 319
294 #define LOW 320
295 #define NORMAL 321
296 #define HIGH 322
297 #define ANY 323
298 #define MESSAGE 324
299 #define INCLUDE 325
300 #define PERSONAL 326
301 #define GLOBAL 327
302 #define RETURN 328
303 #define COPY 329
304 #define YYERRCODE 256
305 static const short yylhs[] = { -1,
306 0, 0, 25, 25, 26, 1, 1, 2, 2, 2,
307 4, 4, 4, 3, 3, 3, 3, 3, 3, 3,
308 3, 3, 3, 3, 3, 3, 3, 3, 3, 14,
309 14, 14, 22, 22, 22, 22, 22, 22, 23, 23,
310 23, 23, 24, 24, 24, 21, 21, 21, 21, 21,
311 21, 21, 6, 6, 7, 7, 5, 5, 8, 8,
312 8, 8, 8, 8, 8, 8, 8, 8, 8, 13,
313 13, 19, 19, 19, 19, 19, 18, 18, 18, 18,
314 20, 20, 20, 20, 20, 20, 20, 12, 12, 12,
315 12, 12, 9, 9, 9, 9, 10, 10, 11, 11,
316 15, 15, 16, 17, 17,
317 };
318 static const short yylen[] = { 2,
319 1, 2, 0, 2, 3, 1, 2, 2, 4, 2,
320 0, 4, 2, 2, 3, 3, 1, 1, 1, 3,
321 2, 2, 2, 1, 1, 2, 2, 3, 1, 0,
322 1, 1, 0, 3, 3, 3, 2, 3, 0, 2,
323 3, 3, 1, 1, 1, 0, 3, 3, 3, 3,
324 3, 2, 3, 1, 1, 3, 3, 2, 2, 2,
325 2, 1, 1, 4, 4, 3, 2, 3, 1, 1,
326 1, 0, 2, 2, 3, 3, 0, 2, 3, 3,
327 0, 2, 2, 3, 2, 3, 3, 1, 1, 1,
328 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329 0, 1, 3, 1, 3,
330 };
331 static const short yydefred[] = { 0,
332 0, 0, 0, 0, 54, 0, 0, 0, 0, 0,
333 0, 0, 17, 18, 19, 46, 0, 0, 0, 24,
334 25, 33, 39, 0, 29, 2, 0, 0, 4, 55,
335 0, 5, 10, 69, 0, 0, 0, 62, 63, 77,
336 0, 0, 70, 71, 81, 0, 72, 14, 102, 0,
337 0, 0, 21, 22, 23, 0, 0, 31, 32, 0,
338 7, 8, 53, 0, 0, 59, 60, 61, 0, 67,
339 99, 100, 0, 0, 0, 0, 0, 15, 16, 20,
340 0, 0, 0, 0, 0, 52, 0, 0, 0, 43,
341 44, 45, 0, 37, 93, 94, 95, 96, 97, 98,
342 0, 0, 40, 28, 56, 0, 0, 0, 0, 78,
343 0, 68, 0, 82, 83, 0, 66, 85, 0, 58,
344 0, 0, 0, 9, 0, 88, 89, 90, 91, 92,
345 0, 74, 0, 73, 47, 48, 49, 50, 51, 35,
346 34, 36, 38, 41, 42, 0, 103, 80, 64, 79,
347 87, 84, 86, 57, 0, 13, 76, 65, 75, 105,
348 0, 12,
349 };
350 static const short yydgoto[] = { 2,
351 26, 27, 28, 124, 76, 7, 31, 106, 101, 102,
352 73, 134, 47, 60, 50, 66, 107, 69, 77, 74,
353 52, 56, 57, 94, 3, 4,
354 };
355 static const short yysindex[] = { -253,
356 -89, 0, -230, -253, 0, -235, -34, -32, -196, -228,
357 -298, -298, 0, 0, 0, 0, -89, -89, -89, 0,
358 0, 0, 0, -313, 0, 0, -230, 4, 0, 0,
359 -35, 0, 0, 0, 26, 26, -89, 0, 0, 0,
360 -196, -276, 0, 0, 0, -56, 0, 0, 0, -190,
361 -181, -241, 0, 0, 0, -213, -242, 0, 0, -166,
362 0, 0, 0, -165, -196, 0, 0, 0, -63, 0,
363 0, 0, -163, -91, -113, -206, -83, 0, 0, 0,
364 -160, -89, -159, -158, -157, 0, -156, -148, -89, 0,
365 0, 0, -146, 0, 0, 0, 0, 0, 0, 0,
366 -145, -144, 0, 0, 0, 71, 75, -141, -89, 0,
367 -139, 0, -137, 0, 0, -89, 0, 0, -136, 0,
368 -1, -196, -56, 0, -135, 0, 0, 0, 0, 0,
369 -89, 0, -133, 0, 0, 0, 0, 0, 0, 0,
370 0, 0, 0, 0, 0, -196, 0, 0, 0, 0,
371 0, 0, 0, 0, -56, 0, 0, 0, 0, 0,
372 -206, 0,
373 };
374 static const short yyrindex[] = { 22,
375 0, 0, 127, 22, 0, 0, 0, 0, 0, 0,
376 -129, -129, 0, 0, 0, 0, 0, 0, 0, 0,
377 0, 0, 0, -235, 0, 0, 3, 0, 0, 0,
378 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
379 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
380 0, 0, 0, 0, 0, 72, 73, 0, 0, 0,
381 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
382 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
383 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
384 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
385 0, 0, 0, 0, 0, 89, 0, 0, 0, 0,
386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
387 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
388 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
389 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
391 1, 0,
392 };
393 static const short yygindex[] = { 0,
394 -16, 0, 0, -28, -102, -13, 0, -2, -59, -12,
395 0, 0, 0, 0, 122, 99, -10, 0, 0, 0,
396 0, 0, 0, 80, 134, 0,
397 };
398 #define YYTABLESIZE 350
399 static const short yytable[] = { 6,
400 11, 6, 6, 53, 54, 55, 46, 6, 64, 110,
401 61, 120, 58, 59, 118, 1, 80, 132, 71, 72,
402 156, 3, 30, 68, 32, 8, 33, 6, 9, 48,
403 49, 10, 11, 12, 13, 14, 15, 16, 70, 17,
404 18, 19, 20, 21, 22, 23, 95, 96, 97, 98,
405 99, 100, 161, 122, 123, 109, 111, 63, 121, 34,
406 117, 119, 62, 131, 133, 65, 75, 78, 136, 81,
407 82, 83, 84, 85, 86, 142, 79, 90, 91, 92,
408 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
409 45, 104, 105, 112, 24, 149, 135, 25, 137, 138,
410 139, 140, 152, 87, 88, 89, 90, 91, 92, 141,
411 93, 143, 144, 145, 146, 147, 148, 158, 150, 155,
412 151, 153, 157, 154, 159, 11, 1, 6, 101, 104,
413 26, 27, 162, 51, 67, 160, 103, 29, 0, 0,
414 0, 0, 8, 0, 0, 9, 0, 0, 10, 11,
415 12, 13, 14, 15, 16, 0, 17, 18, 19, 20,
416 21, 22, 23, 0, 0, 0, 5, 0, 5, 0,
417 0, 0, 0, 0, 5, 0, 0, 0, 0, 0,
418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
419 0, 0, 0, 0, 5, 0, 113, 95, 96, 97,
420 98, 99, 100, 0, 125, 95, 96, 97, 98, 99,
421 100, 24, 0, 0, 25, 0, 114, 115, 116, 126,
422 127, 128, 129, 130, 108, 95, 96, 97, 98, 99,
423 100, 0, 0, 0, 0, 0, 0, 0, 0, 0,
424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
425 0, 0, 0, 0, 0, 0, 11, 0, 0, 11,
426 0, 0, 11, 11, 11, 11, 11, 11, 11, 0,
427 11, 11, 11, 11, 11, 11, 11, 3, 0, 0,
428 3, 0, 0, 3, 3, 3, 3, 3, 3, 3,
429 0, 3, 3, 3, 3, 3, 3, 3, 0, 0,
430 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
431 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
432 0, 0, 0, 0, 0, 11, 0, 0, 11, 0,
433 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
434 0, 0, 0, 0, 0, 0, 3, 0, 0, 3,
435 };
436 static const short yycheck[] = { 91,
437 0, 91, 0, 17, 18, 19, 9, 91, 44, 69,
438 27, 125, 326, 327, 74, 269, 258, 77, 295, 296,
439 123, 0, 258, 37, 59, 256, 59, 91, 259, 258,
440 329, 262, 263, 264, 265, 266, 267, 268, 41, 270,
441 271, 272, 273, 274, 275, 276, 289, 290, 291, 292,
442 293, 294, 155, 260, 261, 69, 69, 93, 75, 256,
443 74, 74, 59, 77, 77, 40, 123, 258, 82, 311,
444 312, 313, 314, 315, 316, 89, 258, 320, 321, 322,
445 277, 278, 279, 280, 281, 282, 283, 284, 285, 286,
446 287, 258, 258, 257, 325, 109, 257, 328, 258, 258,
447 258, 258, 116, 317, 318, 319, 320, 321, 322, 258,
448 324, 258, 258, 258, 44, 41, 258, 131, 258, 122,
449 258, 258, 258, 125, 258, 125, 0, 125, 258, 41,
450 59, 59, 161, 12, 36, 146, 57, 4, -1, -1,
451 -1, -1, 256, -1, -1, 259, -1, -1, 262, 263,
452 264, 265, 266, 267, 268, -1, 270, 271, 272, 273,
453 274, 275, 276, -1, -1, -1, 258, -1, 258, -1,
454 -1, -1, -1, -1, 258, -1, -1, -1, -1, -1,
455 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
456 -1, -1, -1, -1, 258, -1, 288, 289, 290, 291,
457 292, 293, 294, -1, 288, 289, 290, 291, 292, 293,
458 294, 325, -1, -1, 328, -1, 308, 309, 310, 303,
459 304, 305, 306, 307, 288, 289, 290, 291, 292, 293,
460 294, -1, -1, -1, -1, -1, -1, -1, -1, -1,
461 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
462 -1, -1, -1, -1, -1, -1, 256, -1, -1, 259,
463 -1, -1, 262, 263, 264, 265, 266, 267, 268, -1,
464 270, 271, 272, 273, 274, 275, 276, 256, -1, -1,
465 259, -1, -1, 262, 263, 264, 265, 266, 267, 268,
466 -1, 270, 271, 272, 273, 274, 275, 276, -1, -1,
467 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
468 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
469 -1, -1, -1, -1, -1, 325, -1, -1, 328, -1,
470 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
471 -1, -1, -1, -1, -1, -1, 325, -1, -1, 328,
472 };
473 #define YYFINAL 2
474 #ifndef YYDEBUG
475 #define YYDEBUG 0
476 #endif
477 #define YYMAXTOKEN 329
478 #if YYDEBUG
479 static const char *yyname[] = {
480
481 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
482 0,0,0,0,0,0,"'('","')'",0,0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0,0,0,0,0,0,
483 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,0,0,0,0,0,
484 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'",0,"'}'",0,0,0,0,0,0,0,0,0,0,0,0,
485 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
486 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
487 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
488 "NUMBER","STRING","IF","ELSIF","ELSE","REJCT","FILEINTO","REDIRECT","KEEP",
489 "STOP","DISCARD","VACATION","REQUIRE","SETFLAG","ADDFLAG","REMOVEFLAG","MARK",
490 "UNMARK","NOTIFY","DENOTIFY","ANYOF","ALLOF","EXISTS","SFALSE","STRUE","HEADER",
491 "NOT","SIZE","ADDRESS","ENVELOPE","BODY","COMPARATOR","IS","CONTAINS","MATCHES",
492 "REGEX","COUNT","VALUE","OVER","UNDER","GT","GE","LT","LE","EQ","NE","ALL",
493 "LOCALPART","DOMAIN","USER","DETAIL","RAW","TEXT","CONTENT","DAYS","ADDRESSES",
494 "SUBJECT","FROM","HANDLE","MIME","METHOD","ID","OPTIONS","LOW","NORMAL","HIGH",
495 "ANY","MESSAGE","INCLUDE","PERSONAL","GLOBAL","RETURN","COPY",
496 };
497 static const char *yyrule[] = {
498 "$accept : start",
499 "start : reqs",
500 "start : reqs commands",
501 "reqs :",
502 "reqs : require reqs",
503 "require : REQUIRE stringlist ';'",
504 "commands : command",
505 "commands : command commands",
506 "command : action ';'",
507 "command : IF test block elsif",
508 "command : error ';'",
509 "elsif :",
510 "elsif : ELSIF test block elsif",
511 "elsif : ELSE block",
512 "action : REJCT STRING",
513 "action : FILEINTO copy STRING",
514 "action : REDIRECT copy STRING",
515 "action : KEEP",
516 "action : STOP",
517 "action : DISCARD",
518 "action : VACATION vtags STRING",
519 "action : SETFLAG stringlist",
520 "action : ADDFLAG stringlist",
521 "action : REMOVEFLAG stringlist",
522 "action : MARK",
523 "action : UNMARK",
524 "action : NOTIFY ntags",
525 "action : DENOTIFY dtags",
526 "action : INCLUDE location STRING",
527 "action : RETURN",
528 "location :",
529 "location : PERSONAL",
530 "location : GLOBAL",
531 "ntags :",
532 "ntags : ntags ID STRING",
533 "ntags : ntags METHOD STRING",
534 "ntags : ntags OPTIONS stringlist",
535 "ntags : ntags priority",
536 "ntags : ntags MESSAGE STRING",
537 "dtags :",
538 "dtags : dtags priority",
539 "dtags : dtags comptag STRING",
540 "dtags : dtags relcomp STRING",
541 "priority : LOW",
542 "priority : NORMAL",
543 "priority : HIGH",
544 "vtags :",
545 "vtags : vtags DAYS NUMBER",
546 "vtags : vtags ADDRESSES stringlist",
547 "vtags : vtags SUBJECT STRING",
548 "vtags : vtags FROM STRING",
549 "vtags : vtags HANDLE STRING",
550 "vtags : vtags MIME",
551 "stringlist : '[' strings ']'",
552 "stringlist : STRING",
553 "strings : STRING",
554 "strings : strings ',' STRING",
555 "block : '{' commands '}'",
556 "block : '{' '}'",
557 "test : ANYOF testlist",
558 "test : ALLOF testlist",
559 "test : EXISTS stringlist",
560 "test : SFALSE",
561 "test : STRUE",
562 "test : HEADER htags stringlist stringlist",
563 "test : addrorenv aetags stringlist stringlist",
564 "test : BODY btags stringlist",
565 "test : NOT test",
566 "test : SIZE sizetag NUMBER",
567 "test : error",
568 "addrorenv : ADDRESS",
569 "addrorenv : ENVELOPE",
570 "aetags :",
571 "aetags : aetags addrparttag",
572 "aetags : aetags comptag",
573 "aetags : aetags relcomp STRING",
574 "aetags : aetags COMPARATOR STRING",
575 "htags :",
576 "htags : htags comptag",
577 "htags : htags relcomp STRING",
578 "htags : htags COMPARATOR STRING",
579 "btags :",
580 "btags : btags RAW",
581 "btags : btags TEXT",
582 "btags : btags CONTENT stringlist",
583 "btags : btags comptag",
584 "btags : btags relcomp STRING",
585 "btags : btags COMPARATOR STRING",
586 "addrparttag : ALL",
587 "addrparttag : LOCALPART",
588 "addrparttag : DOMAIN",
589 "addrparttag : USER",
590 "addrparttag : DETAIL",
591 "comptag : IS",
592 "comptag : CONTAINS",
593 "comptag : MATCHES",
594 "comptag : REGEX",
595 "relcomp : COUNT",
596 "relcomp : VALUE",
597 "sizetag : OVER",
598 "sizetag : UNDER",
599 "copy :",
600 "copy : COPY",
601 "testlist : '(' tests ')'",
602 "tests : test",
603 "tests : test ',' tests",
604
605 };
606 #endif
607 /* define the initial stack-sizes */
608 #ifdef YYSTACKSIZE
609 #undef YYMAXDEPTH
610 #define YYMAXDEPTH YYSTACKSIZE
611 #else
612 #ifdef YYMAXDEPTH
613 #define YYSTACKSIZE YYMAXDEPTH
614 #else
615 #define YYSTACKSIZE 500
616 #define YYMAXDEPTH 500
617 #endif
618 #endif
619
620 #define YYINITSTACKSIZE 500
621
622 int yydebug;
623 int yynerrs;
624
625 typedef struct {
626 unsigned stacksize;
627 short *s_base;
628 short *s_mark;
629 short *s_last;
630 YYSTYPE *l_base;
631 YYSTYPE *l_mark;
632 } YYSTACKDATA;
633 int yyerrflag;
634 int yychar;
635 YYSTYPE yyval;
636 YYSTYPE yylval;
637
638 /* variables for the parser stack */
639 static YYSTACKDATA yystack;
640 #line 701 "sieve.y"
2904 {
2905 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2906 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2907 {
2908 YYSIZE_T yyalloc = 2 * yysize;
2909 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2910 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2911 if (yymsg != yymsgbuf)
2912 YYSTACK_FREE (yymsg);
2913 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2914 if (yymsg)
2915 yymsg_alloc = yyalloc;
2916 else
2917 {
2918 yymsg = yymsgbuf;
2919 yymsg_alloc = sizeof yymsgbuf;
2920 }
2921 }
2922
2923 if (0 < yysize && yysize <= yymsg_alloc)
2924 {
2925 (void) yysyntax_error (yymsg, yystate, yychar);
2926 yyerror (yymsg);
2927 }
2928 else
2929 {
2930 yyerror (YY_("syntax error"));
2931 if (yysize != 0)
2932 goto yyexhaustedlab;
2933 }
2934 }
2935 #endif
2936 }
2937
2938
2939
2940 if (yyerrstatus == 3)
2941 {
2942 /* If just tried and failed to reuse lookahead token after an
2943 error, discard it. */
2944
2945 if (yychar <= YYEOF)
2946 {
2947 /* Return failure if at end of input. */
2948 if (yychar == YYEOF)
2949 YYABORT;
2950 }
2951 else
2952 {
2953 yydestruct ("Error: discarding",
2954 yytoken, &yylval);
2955 yychar = YYEMPTY;
2956 }
2957 }
2958
2959 /* Else will try to reuse lookahead token after shifting the error
2960 token. */
2961 goto yyerrlab1;
2962
2963
2964 /*---------------------------------------------------.
2965 | yyerrorlab -- error raised explicitly by YYERROR. |
2966 `---------------------------------------------------*/
2967 yyerrorlab:
2968
2969 /* Pacify compilers like GCC when the user code never invokes
2970 YYERROR and the label yyerrorlab therefore never appears in user
2971 code. */
2972 if (/*CONSTCOND*/ 0)
2973 goto yyerrorlab;
2974
2975 /* Do not reclaim the symbols of the rule which action triggered
2976 this YYERROR. */
2977 YYPOPSTACK (yylen);
2978 yylen = 0;
2979 YY_STACK_PRINT (yyss, yyssp);
2980 yystate = *yyssp;
2981 goto yyerrlab1;
2982
2983
2984 /*-------------------------------------------------------------.
2985 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2986 `-------------------------------------------------------------*/
2987 yyerrlab1:
2988 yyerrstatus = 3; /* Each real token shifted decrements this. */
2989
2990 for (;;)
2991 {
2992 yyn = yypact[yystate];
2993 if (yyn != YYPACT_NINF)
2994 {
2995 yyn += YYTERROR;
2996 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2997 {
2998 yyn = yytable[yyn];
2999 if (0 < yyn)
3000 break;
3001 }
3002 }
3003
3004 /* Pop the current state because it cannot handle the error token. */
3005 if (yyssp == yyss)
3006 YYABORT;
3007
3008
3009 yydestruct ("Error: popping",
3010 yystos[yystate], yyvsp);
3011 YYPOPSTACK (1);
3012 yystate = *yyssp;
3013 YY_STACK_PRINT (yyss, yyssp);
3014 }
3015
3016 *++yyvsp = yylval;
3017
3018
3019 /* Shift the error token. */
3020 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3021
3022 yystate = yyn;
3023 goto yynewstate;
3024
3025
3026 /*-------------------------------------.
3027 | yyacceptlab -- YYACCEPT comes here. |
3028 `-------------------------------------*/
3029 yyacceptlab:
3030 yyresult = 0;
3031 goto yyreturn;
3032
3033 /*-----------------------------------.
3034 | yyabortlab -- YYABORT comes here. |
3035 `-----------------------------------*/
3036 yyabortlab:
3037 yyresult = 1;
3038 goto yyreturn;
3039
3040 #if !defined(yyoverflow) || YYERROR_VERBOSE
3041 /*-------------------------------------------------.
3042 | yyexhaustedlab -- memory exhaustion comes here. |
3043 `-------------------------------------------------*/
3044 yyexhaustedlab:
3045 yyerror (YY_("memory exhausted"));
3046 yyresult = 2;
3047 /* Fall through. */
3048 #endif
3049
3050 yyreturn:
3051 if (yychar != YYEMPTY)
3052 yydestruct ("Cleanup: discarding lookahead",
3053 yytoken, &yylval);
3054 /* Do not reclaim the symbols of the rule which action triggered
3055 this YYABORT or YYACCEPT. */
3056 YYPOPSTACK (yylen);
3057 YY_STACK_PRINT (yyss, yyssp);
3058 while (yyssp != yyss)
3059 {
3060 yydestruct ("Cleanup: popping",
3061 yystos[*yyssp], yyvsp);
3062 YYPOPSTACK (1);
3063 }
3064 #ifndef yyoverflow
3065 if (yyss != yyssa)
3066 YYSTACK_FREE (yyss);
3067 #endif
3068 #if YYERROR_VERBOSE
3069 if (yymsg != yymsgbuf)
3070 YYSTACK_FREE (yymsg);
3071 #endif
3072 /* Make sure YYID is used. */
3073 return YYID (yyresult);
3074 }
3075
3076
3077
3078 /* Line 1675 of yacc.c */
3079 #line 700 "sieve.y"
3080
6413081 commandlist_t *sieve_parse(sieve_script_t *script, FILE *f)
6423082 {
6433083 commandlist_t *t;
12863726
12873727 return 1;
12883728 }
1289 #line 1290 "y.tab.c"
1290
1291 #if YYDEBUG
1292 #include <stdio.h> /* needed for printf */
1293 #endif
1294
1295 #include <stdlib.h> /* needed for malloc, etc */
1296 #include <string.h> /* needed for memset */
1297
1298 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
1299 static int yygrowstack(YYSTACKDATA *data)
1300 {
1301 int i;
1302 unsigned newsize;
1303 short *newss;
1304 YYSTYPE *newvs;
1305
1306 if ((newsize = data->stacksize) == 0)
1307 newsize = YYINITSTACKSIZE;
1308 else if (newsize >= YYMAXDEPTH)
1309 return -1;
1310 else if ((newsize *= 2) > YYMAXDEPTH)
1311 newsize = YYMAXDEPTH;
1312
1313 i = data->s_mark - data->s_base;
1314 newss = (data->s_base != 0)
1315 ? (short *)realloc(data->s_base, newsize * sizeof(*newss))
1316 : (short *)malloc(newsize * sizeof(*newss));
1317 if (newss == 0)
1318 return -1;
1319
1320 data->s_base = newss;
1321 data->s_mark = newss + i;
1322
1323 newvs = (data->l_base != 0)
1324 ? (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs))
1325 : (YYSTYPE *)malloc(newsize * sizeof(*newvs));
1326 if (newvs == 0)
1327 return -1;
1328
1329 data->l_base = newvs;
1330 data->l_mark = newvs + i;
1331
1332 data->stacksize = newsize;
1333 data->s_last = data->s_base + newsize - 1;
1334 return 0;
1335 }
1336
1337 #if YYPURE || defined(YY_NO_LEAKS)
1338 static void yyfreestack(YYSTACKDATA *data)
1339 {
1340 free(data->s_base);
1341 free(data->l_base);
1342 memset(data, 0, sizeof(*data));
1343 }
1344 #else
1345 #define yyfreestack(data) /* nothing */
1346 #endif
1347
1348 #define YYABORT goto yyabort
1349 #define YYREJECT goto yyabort
1350 #define YYACCEPT goto yyaccept
1351 #define YYERROR goto yyerrlab
1352
1353 int
1354 YYPARSE_DECL()
1355 {
1356 int yym, yyn, yystate;
1357 #if YYDEBUG
1358 const char *yys;
1359
1360 if ((yys = getenv("YYDEBUG")) != 0)
1361 {
1362 yyn = *yys;
1363 if (yyn >= '0' && yyn <= '9')
1364 yydebug = yyn - '0';
1365 }
1366 #endif
1367
1368 yynerrs = 0;
1369 yyerrflag = 0;
1370 yychar = YYEMPTY;
1371 yystate = 0;
1372
1373 #if YYPURE
1374 memset(&yystack, 0, sizeof(yystack));
1375 #endif
1376
1377 if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
1378 yystack.s_mark = yystack.s_base;
1379 yystack.l_mark = yystack.l_base;
1380 yystate = 0;
1381 *yystack.s_mark = 0;
1382
1383 yyloop:
1384 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
1385 if (yychar < 0)
1386 {
1387 if ((yychar = YYLEX) < 0) yychar = 0;
1388 #if YYDEBUG
1389 if (yydebug)
1390 {
1391 yys = 0;
1392 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
1393 if (!yys) yys = "illegal-symbol";
1394 printf("%sdebug: state %d, reading %d (%s)\n",
1395 YYPREFIX, yystate, yychar, yys);
1396 }
1397 #endif
1398 }
1399 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
1400 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
1401 {
1402 #if YYDEBUG
1403 if (yydebug)
1404 printf("%sdebug: state %d, shifting to state %d\n",
1405 YYPREFIX, yystate, yytable[yyn]);
1406 #endif
1407 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
1408 {
1409 goto yyoverflow;
1410 }
1411 yystate = yytable[yyn];
1412 *++yystack.s_mark = yytable[yyn];
1413 *++yystack.l_mark = yylval;
1414 yychar = YYEMPTY;
1415 if (yyerrflag > 0) --yyerrflag;
1416 goto yyloop;
1417 }
1418 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
1419 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
1420 {
1421 yyn = yytable[yyn];
1422 goto yyreduce;
1423 }
1424 if (yyerrflag) goto yyinrecovery;
1425
1426 yyerror("syntax error");
1427
1428 goto yyerrlab;
1429
1430 yyerrlab:
1431 ++yynerrs;
1432
1433 yyinrecovery:
1434 if (yyerrflag < 3)
1435 {
1436 yyerrflag = 3;
1437 for (;;)
1438 {
1439 if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
1440 yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
1441 {
1442 #if YYDEBUG
1443 if (yydebug)
1444 printf("%sdebug: state %d, error recovery shifting\
1445 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
1446 #endif
1447 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
1448 {
1449 goto yyoverflow;
1450 }
1451 yystate = yytable[yyn];
1452 *++yystack.s_mark = yytable[yyn];
1453 *++yystack.l_mark = yylval;
1454 goto yyloop;
1455 }
1456 else
1457 {
1458 #if YYDEBUG
1459 if (yydebug)
1460 printf("%sdebug: error recovery discarding state %d\n",
1461 YYPREFIX, *yystack.s_mark);
1462 #endif
1463 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1464 --yystack.s_mark;
1465 --yystack.l_mark;
1466 }
1467 }
1468 }
1469 else
1470 {
1471 if (yychar == 0) goto yyabort;
1472 #if YYDEBUG
1473 if (yydebug)
1474 {
1475 yys = 0;
1476 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
1477 if (!yys) yys = "illegal-symbol";
1478 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
1479 YYPREFIX, yystate, yychar, yys);
1480 }
1481 #endif
1482 yychar = YYEMPTY;
1483 goto yyloop;
1484 }
1485
1486 yyreduce:
1487 #if YYDEBUG
1488 if (yydebug)
1489 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
1490 YYPREFIX, yystate, yyn, yyrule[yyn]);
1491 #endif
1492 yym = yylen[yyn];
1493 if (yym)
1494 yyval = yystack.l_mark[1-yym];
1495 else
1496 memset(&yyval, 0, sizeof yyval);
1497 switch (yyn)
1498 {
1499 case 1:
1500 #line 222 "sieve.y"
1501 { ret = NULL; }
1502 break;
1503 case 2:
1504 #line 223 "sieve.y"
1505 { ret = yystack.l_mark[0].cl; }
1506 break;
1507 case 5:
1508 #line 230 "sieve.y"
1509 { char *err = check_reqs(yystack.l_mark[-1].sl);
1510 if (err) {
1511 yyerror(err);
1512 free(err);
1513 YYERROR;
1514 } }
1515 break;
1516 case 6:
1517 #line 238 "sieve.y"
1518 { yyval.cl = yystack.l_mark[0].cl; }
1519 break;
1520 case 7:
1521 #line 239 "sieve.y"
1522 { yystack.l_mark[-1].cl->next = yystack.l_mark[0].cl; yyval.cl = yystack.l_mark[-1].cl; }
1523 break;
1524 case 8:
1525 #line 242 "sieve.y"
1526 { yyval.cl = yystack.l_mark[-1].cl; }
1527 break;
1528 case 9:
1529 #line 243 "sieve.y"
1530 { yyval.cl = new_if(yystack.l_mark[-2].test, yystack.l_mark[-1].cl, yystack.l_mark[0].cl); }
1531 break;
1532 case 10:
1533 #line 244 "sieve.y"
1534 { yyval.cl = new_command(STOP); }
1535 break;
1536 case 11:
1537 #line 247 "sieve.y"
1538 { yyval.cl = NULL; }
1539 break;
1540 case 12:
1541 #line 248 "sieve.y"
1542 { yyval.cl = new_if(yystack.l_mark[-2].test, yystack.l_mark[-1].cl, yystack.l_mark[0].cl); }
1543 break;
1544 case 13:
1545 #line 249 "sieve.y"
1546 { yyval.cl = yystack.l_mark[0].cl; }
1547 break;
1548 case 14:
1549 #line 252 "sieve.y"
1550 { if (!parse_script->support.reject) {
1551 yyerror("reject MUST be enabled with \"require\"");
1552 YYERROR;
1553 }
1554 if (!verify_utf8(yystack.l_mark[0].sval)) {
1555 YYERROR; /* vu should call yyerror() */
1556 }
1557 yyval.cl = new_command(REJCT);
1558 yyval.cl->u.str = yystack.l_mark[0].sval; }
1559 break;
1560 case 15:
1561 #line 261 "sieve.y"
1562 { if (!parse_script->support.fileinto) {
1563 yyerror("fileinto MUST be enabled with \"require\"");
1564 YYERROR;
1565 }
1566 if (!verify_mailbox(yystack.l_mark[0].sval)) {
1567 YYERROR; /* vm should call yyerror() */
1568 }
1569 yyval.cl = build_fileinto(FILEINTO, yystack.l_mark[-1].nval, yystack.l_mark[0].sval); }
1570 break;
1571 case 16:
1572 #line 269 "sieve.y"
1573 { if (!verify_address(yystack.l_mark[0].sval)) {
1574 YYERROR; /* va should call yyerror() */
1575 }
1576 yyval.cl = build_redirect(REDIRECT, yystack.l_mark[-1].nval, yystack.l_mark[0].sval); }
1577 break;
1578 case 17:
1579 #line 273 "sieve.y"
1580 { yyval.cl = new_command(KEEP); }
1581 break;
1582 case 18:
1583 #line 274 "sieve.y"
1584 { yyval.cl = new_command(STOP); }
1585 break;
1586 case 19:
1587 #line 275 "sieve.y"
1588 { yyval.cl = new_command(DISCARD); }
1589 break;
1590 case 20:
1591 #line 276 "sieve.y"
1592 { if (!parse_script->support.vacation) {
1593 yyerror("vacation MUST be enabled with \"require\"");
1594 YYERROR;
1595 }
1596 if ((yystack.l_mark[-1].vtag->mime == -1) && !verify_utf8(yystack.l_mark[0].sval)) {
1597 YYERROR; /* vu should call yyerror() */
1598 }
1599 yyval.cl = build_vacation(VACATION,
1600 canon_vtags(yystack.l_mark[-1].vtag), yystack.l_mark[0].sval); }
1601 break;
1602 case 21:
1603 #line 285 "sieve.y"
1604 { if (!parse_script->support.imapflags) {
1605 yyerror("imapflags MUST be enabled with \"require\"");
1606 YYERROR;
1607 }
1608 if (!verify_stringlist(yystack.l_mark[0].sl, verify_flag)) {
1609 YYERROR; /* vf should call yyerror() */
1610 }
1611 yyval.cl = new_command(SETFLAG);
1612 yyval.cl->u.sl = yystack.l_mark[0].sl; }
1613 break;
1614 case 22:
1615 #line 294 "sieve.y"
1616 { if (!parse_script->support.imapflags) {
1617 yyerror("imapflags MUST be enabled with \"require\"");
1618 YYERROR;
1619 }
1620 if (!verify_stringlist(yystack.l_mark[0].sl, verify_flag)) {
1621 YYERROR; /* vf should call yyerror() */
1622 }
1623 yyval.cl = new_command(ADDFLAG);
1624 yyval.cl->u.sl = yystack.l_mark[0].sl; }
1625 break;
1626 case 23:
1627 #line 303 "sieve.y"
1628 { if (!parse_script->support.imapflags) {
1629 yyerror("imapflags MUST be enabled with \"require\"");
1630 YYERROR;
1631 }
1632 if (!verify_stringlist(yystack.l_mark[0].sl, verify_flag)) {
1633 YYERROR; /* vf should call yyerror() */
1634 }
1635 yyval.cl = new_command(REMOVEFLAG);
1636 yyval.cl->u.sl = yystack.l_mark[0].sl; }
1637 break;
1638 case 24:
1639 #line 312 "sieve.y"
1640 { if (!parse_script->support.imapflags) {
1641 yyerror("imapflags MUST be enabled with \"require\"");
1642 YYERROR;
1643 }
1644 yyval.cl = new_command(MARK); }
1645 break;
1646 case 25:
1647 #line 317 "sieve.y"
1648 { if (!parse_script->support.imapflags) {
1649 yyerror("imapflags MUST be enabled with \"require\"");
1650 YYERROR;
1651 }
1652 yyval.cl = new_command(UNMARK); }
1653 break;
1654 case 26:
1655 #line 323 "sieve.y"
1656 { if (!parse_script->support.notify) {
1657 yyerror("notify MUST be enabled with \"require\"");
1658 yyval.cl = new_command(NOTIFY);
1659 YYERROR;
1660 } else {
1661 yyval.cl = build_notify(NOTIFY,
1662 canon_ntags(yystack.l_mark[0].ntag));
1663 } }
1664 break;
1665 case 27:
1666 #line 331 "sieve.y"
1667 { if (!parse_script->support.notify) {
1668 yyerror("notify MUST be enabled with \"require\"");
1669 yyval.cl = new_command(DENOTIFY);
1670 YYERROR;
1671 } else {
1672 yyval.cl = build_denotify(DENOTIFY, canon_dtags(yystack.l_mark[0].dtag));
1673 if (yyval.cl == NULL) {
1674 yyerror("unable to find a compatible comparator");
1675 YYERROR; } } }
1676 break;
1677 case 28:
1678 #line 341 "sieve.y"
1679 { if (!parse_script->support.include) {
1680 yyerror("include MUST be enabled with \"require\"");
1681 YYERROR;
1682 }
1683 yyval.cl = new_command(INCLUDE);
1684 yyval.cl->u.inc.location = yystack.l_mark[-1].nval;
1685 yyval.cl->u.inc.script = yystack.l_mark[0].sval; }
1686 break;
1687 case 29:
1688 #line 348 "sieve.y"
1689 { if (!parse_script->support.include) {
1690 yyerror("include MUST be enabled with \"require\"");
1691 YYERROR;
1692 }
1693 yyval.cl = new_command(RETURN); }
1694 break;
1695 case 30:
1696 #line 355 "sieve.y"
1697 { yyval.nval = PERSONAL; }
1698 break;
1699 case 31:
1700 #line 356 "sieve.y"
1701 { yyval.nval = PERSONAL; }
1702 break;
1703 case 32:
1704 #line 357 "sieve.y"
1705 { yyval.nval = GLOBAL; }
1706 break;
1707 case 33:
1708 #line 360 "sieve.y"
1709 { yyval.ntag = new_ntags(); }
1710 break;
1711 case 34:
1712 #line 361 "sieve.y"
1713 { if (yyval.ntag->id != NULL) {
1714 yyerror("duplicate :method"); YYERROR; }
1715 else { yyval.ntag->id = yystack.l_mark[0].sval; } }
1716 break;
1717 case 35:
1718 #line 364 "sieve.y"
1719 { if (yyval.ntag->method != NULL) {
1720 yyerror("duplicate :method"); YYERROR; }
1721 else { yyval.ntag->method = yystack.l_mark[0].sval; } }
1722 break;
1723 case 36:
1724 #line 367 "sieve.y"
1725 { if (yyval.ntag->options != NULL) {
1726 yyerror("duplicate :options"); YYERROR; }
1727 else { yyval.ntag->options = yystack.l_mark[0].sl; } }
1728 break;
1729 case 37:
1730 #line 370 "sieve.y"
1731 { if (yyval.ntag->priority != -1) {
1732 yyerror("duplicate :priority"); YYERROR; }
1733 else { yyval.ntag->priority = yystack.l_mark[0].nval; } }
1734 break;
1735 case 38:
1736 #line 373 "sieve.y"
1737 { if (yyval.ntag->message != NULL) {
1738 yyerror("duplicate :message"); YYERROR; }
1739 else { yyval.ntag->message = yystack.l_mark[0].sval; } }
1740 break;
1741 case 39:
1742 #line 378 "sieve.y"
1743 { yyval.dtag = new_dtags(); }
1744 break;
1745 case 40:
1746 #line 379 "sieve.y"
1747 { if (yyval.dtag->priority != -1) {
1748 yyerror("duplicate priority level"); YYERROR; }
1749 else { yyval.dtag->priority = yystack.l_mark[0].nval; } }
1750 break;
1751 case 41:
1752 #line 382 "sieve.y"
1753 { if (yyval.dtag->comptag != -1)
1754 {
1755 yyerror("duplicate comparator type tag"); YYERROR;
1756 }
1757 yyval.dtag->comptag = yystack.l_mark[-1].nval;
1758 #ifdef ENABLE_REGEX
1759 if (yyval.dtag->comptag == REGEX)
1760 {
1761 int cflags = REG_EXTENDED |
1762 REG_NOSUB | REG_ICASE;
1763 if (!verify_regex(yystack.l_mark[0].sval, cflags)) { YYERROR; }
1764 }
1765 #endif
1766 yyval.dtag->pattern = yystack.l_mark[0].sval;
1767 }
1768 break;
1769 case 42:
1770 #line 397 "sieve.y"
1771 { yyval.dtag = yystack.l_mark[-2].dtag;
1772 if (yyval.dtag->comptag != -1) {
1773 yyerror("duplicate comparator type tag"); YYERROR; }
1774 else { yyval.dtag->comptag = yystack.l_mark[-1].nval;
1775 yyval.dtag->relation = verify_relat(yystack.l_mark[0].sval);
1776 if (yyval.dtag->relation==-1)
1777 {YYERROR; /*vr called yyerror()*/ }
1778 } }
1779 break;
1780 case 43:
1781 #line 407 "sieve.y"
1782 { yyval.nval = LOW; }
1783 break;
1784 case 44:
1785 #line 408 "sieve.y"
1786 { yyval.nval = NORMAL; }
1787 break;
1788 case 45:
1789 #line 409 "sieve.y"
1790 { yyval.nval = HIGH; }
1791 break;
1792 case 46:
1793 #line 412 "sieve.y"
1794 { yyval.vtag = new_vtags(); }
1795 break;
1796 case 47:
1797 #line 413 "sieve.y"
1798 { if (yyval.vtag->days != -1) {
1799 yyerror("duplicate :days"); YYERROR; }
1800 else { yyval.vtag->days = yystack.l_mark[0].nval; } }
1801 break;
1802 case 48:
1803 #line 416 "sieve.y"
1804 { if (yyval.vtag->addresses != NULL) {
1805 yyerror("duplicate :addresses");
1806 YYERROR;
1807 } else if (!verify_stringlist(yystack.l_mark[0].sl,
1808 verify_address)) {
1809 YYERROR;
1810 } else {
1811 yyval.vtag->addresses = yystack.l_mark[0].sl; } }
1812 break;
1813 case 49:
1814 #line 424 "sieve.y"
1815 { if (yyval.vtag->subject != NULL) {
1816 yyerror("duplicate :subject");
1817 YYERROR;
1818 } else if (!verify_utf8(yystack.l_mark[0].sval)) {
1819 YYERROR; /* vu should call yyerror() */
1820 } else { yyval.vtag->subject = yystack.l_mark[0].sval; } }
1821 break;
1822 case 50:
1823 #line 430 "sieve.y"
1824 { if (yyval.vtag->from != NULL) {
1825 yyerror("duplicate :from");
1826 YYERROR;
1827 } else if (!verify_address(yystack.l_mark[0].sval)) {
1828 YYERROR; /* vu should call yyerror() */
1829 } else { yyval.vtag->from = yystack.l_mark[0].sval; } }
1830 break;
1831 case 51:
1832 #line 436 "sieve.y"
1833 { if (yyval.vtag->handle != NULL) {
1834 yyerror("duplicate :handle");
1835 YYERROR;
1836 } else if (!verify_utf8(yystack.l_mark[0].sval)) {
1837 YYERROR; /* vu should call yyerror() */
1838 } else { yyval.vtag->handle = yystack.l_mark[0].sval; } }
1839 break;
1840 case 52:
1841 #line 442 "sieve.y"
1842 { if (yyval.vtag->mime != -1) {
1843 yyerror("duplicate :mime");
1844 YYERROR; }
1845 else { yyval.vtag->mime = MIME; } }
1846 break;
1847 case 53:
1848 #line 448 "sieve.y"
1849 { yyval.sl = sl_reverse(yystack.l_mark[-1].sl); }
1850 break;
1851 case 54:
1852 #line 449 "sieve.y"
1853 { yyval.sl = new_sl(yystack.l_mark[0].sval, NULL); }
1854 break;
1855 case 55:
1856 #line 452 "sieve.y"
1857 { yyval.sl = new_sl(yystack.l_mark[0].sval, NULL); }
1858 break;
1859 case 56:
1860 #line 453 "sieve.y"
1861 { yyval.sl = new_sl(yystack.l_mark[0].sval, yystack.l_mark[-2].sl); }
1862 break;
1863 case 57:
1864 #line 456 "sieve.y"
1865 { yyval.cl = yystack.l_mark[-1].cl; }
1866 break;
1867 case 58:
1868 #line 457 "sieve.y"
1869 { yyval.cl = NULL; }
1870 break;
1871 case 59:
1872 #line 460 "sieve.y"
1873 { yyval.test = new_test(ANYOF); yyval.test->u.tl = yystack.l_mark[0].testl; }
1874 break;
1875 case 60:
1876 #line 461 "sieve.y"
1877 { yyval.test = new_test(ALLOF); yyval.test->u.tl = yystack.l_mark[0].testl; }
1878 break;
1879 case 61:
1880 #line 462 "sieve.y"
1881 { yyval.test = new_test(EXISTS); yyval.test->u.sl = yystack.l_mark[0].sl; }
1882 break;
1883 case 62:
1884 #line 463 "sieve.y"
1885 { yyval.test = new_test(SFALSE); }
1886 break;
1887 case 63:
1888 #line 464 "sieve.y"
1889 { yyval.test = new_test(STRUE); }
1890 break;
1891 case 64:
1892 #line 466 "sieve.y"
1893 {
1894 if (!verify_stringlist(yystack.l_mark[-1].sl, verify_header)) {
1895 YYERROR; /* vh should call yyerror() */
1896 }
1897 if (!verify_stringlist(yystack.l_mark[0].sl, verify_utf8)) {
1898 YYERROR; /* vu should call yyerror() */
1899 }
1900
1901 yystack.l_mark[-2].htag = canon_htags(yystack.l_mark[-2].htag);
1902 #ifdef ENABLE_REGEX
1903 if (yystack.l_mark[-2].htag->comptag == REGEX)
1904 {
1905 if (!(verify_regexs(yystack.l_mark[0].sl, yystack.l_mark[-2].htag->comparator)))
1906 { YYERROR; }
1907 }
1908 #endif
1909 yyval.test = build_header(HEADER, yystack.l_mark[-2].htag, yystack.l_mark[-1].sl, yystack.l_mark[0].sl);
1910 if (yyval.test == NULL) {
1911 yyerror("unable to find a compatible comparator");
1912 YYERROR; }
1913 }
1914 break;
1915 case 65:
1916 #line 490 "sieve.y"
1917 {
1918 if ((yystack.l_mark[-3].nval == ADDRESS) &&
1919 !verify_stringlist(yystack.l_mark[-1].sl, verify_addrheader))
1920 { YYERROR; }
1921 else if ((yystack.l_mark[-3].nval == ENVELOPE) &&
1922 !verify_stringlist(yystack.l_mark[-1].sl, verify_envelope))
1923 { YYERROR; }
1924 yystack.l_mark[-2].aetag = canon_aetags(yystack.l_mark[-2].aetag);
1925 #ifdef ENABLE_REGEX
1926 if (yystack.l_mark[-2].aetag->comptag == REGEX)
1927 {
1928 if (!( verify_regexs(yystack.l_mark[0].sl, yystack.l_mark[-2].aetag->comparator)))
1929 { YYERROR; }
1930 }
1931 #endif
1932 yyval.test = build_address(yystack.l_mark[-3].nval, yystack.l_mark[-2].aetag, yystack.l_mark[-1].sl, yystack.l_mark[0].sl);
1933 if (yyval.test == NULL) {
1934 yyerror("unable to find a compatible comparator");
1935 YYERROR; }
1936 }
1937 break;
1938 case 66:
1939 #line 512 "sieve.y"
1940 {
1941 if (!parse_script->support.body) {
1942 yyerror("body MUST be enabled with \"require\"");
1943 YYERROR;
1944 }
1945
1946 if (!verify_stringlist(yystack.l_mark[0].sl, verify_utf8)) {
1947 YYERROR; /* vu should call yyerror() */
1948 }
1949
1950 yystack.l_mark[-1].btag = canon_btags(yystack.l_mark[-1].btag);
1951 #ifdef ENABLE_REGEX
1952 if (yystack.l_mark[-1].btag->comptag == REGEX)
1953 {
1954 if (!(verify_regexs(yystack.l_mark[0].sl, yystack.l_mark[-1].btag->comparator)))
1955 { YYERROR; }
1956 }
1957 #endif
1958 yyval.test = build_body(BODY, yystack.l_mark[-1].btag, yystack.l_mark[0].sl);
1959 if (yyval.test == NULL) {
1960 yyerror("unable to find a compatible comparator");
1961 YYERROR; }
1962 }
1963 break;
1964 case 67:
1965 #line 537 "sieve.y"
1966 { yyval.test = new_test(NOT); yyval.test->u.t = yystack.l_mark[0].test; }
1967 break;
1968 case 68:
1969 #line 538 "sieve.y"
1970 { yyval.test = new_test(SIZE); yyval.test->u.sz.t = yystack.l_mark[-1].nval;
1971 yyval.test->u.sz.n = yystack.l_mark[0].nval; }
1972 break;
1973 case 69:
1974 #line 540 "sieve.y"
1975 { yyval.test = NULL; }
1976 break;
1977 case 70:
1978 #line 543 "sieve.y"
1979 { yyval.nval = ADDRESS; }
1980 break;
1981 case 71:
1982 #line 544 "sieve.y"
1983 {if (!parse_script->support.envelope)
1984 {yyerror("envelope MUST be enabled with \"require\""); YYERROR;}
1985 else{yyval.nval = ENVELOPE; }
1986 }
1987 break;
1988 case 72:
1989 #line 551 "sieve.y"
1990 { yyval.aetag = new_aetags(); }
1991 break;
1992 case 73:
1993 #line 552 "sieve.y"
1994 { yyval.aetag = yystack.l_mark[-1].aetag;
1995 if (yyval.aetag->addrtag != -1) {
1996 yyerror("duplicate or conflicting address part tag");
1997 YYERROR; }
1998 else { yyval.aetag->addrtag = yystack.l_mark[0].nval; } }
1999 break;
2000 case 74:
2001 #line 557 "sieve.y"
2002 { yyval.aetag = yystack.l_mark[-1].aetag;
2003 if (yyval.aetag->comptag != -1) {
2004 yyerror("duplicate comparator type tag"); YYERROR; }
2005 else { yyval.aetag->comptag = yystack.l_mark[0].nval; } }
2006 break;
2007 case 75:
2008 #line 561 "sieve.y"
2009 { yyval.aetag = yystack.l_mark[-2].aetag;
2010 if (yyval.aetag->comptag != -1) {
2011 yyerror("duplicate comparator type tag"); YYERROR; }
2012 else { yyval.aetag->comptag = yystack.l_mark[-1].nval;
2013 yyval.aetag->relation = verify_relat(yystack.l_mark[0].sval);
2014 if (yyval.aetag->relation==-1)
2015 {YYERROR; /*vr called yyerror()*/ }
2016 } }
2017 break;
2018 case 76:
2019 #line 569 "sieve.y"
2020 { yyval.aetag = yystack.l_mark[-2].aetag;
2021 if (yyval.aetag->comparator != NULL) {
2022 yyerror("duplicate comparator tag"); YYERROR; }
2023 else if (!strcmp(yystack.l_mark[0].sval, "i;ascii-numeric") &&
2024 !parse_script->support.i_ascii_numeric) {
2025 yyerror("comparator-i;ascii-numeric MUST be enabled with \"require\"");
2026 YYERROR; }
2027 else { yyval.aetag->comparator = yystack.l_mark[0].sval; } }
2028 break;
2029 case 77:
2030 #line 579 "sieve.y"
2031 { yyval.htag = new_htags(); }
2032 break;
2033 case 78:
2034 #line 580 "sieve.y"
2035 { yyval.htag = yystack.l_mark[-1].htag;
2036 if (yyval.htag->comptag != -1) {
2037 yyerror("duplicate comparator type tag"); YYERROR; }
2038 else { yyval.htag->comptag = yystack.l_mark[0].nval; } }
2039 break;
2040 case 79:
2041 #line 584 "sieve.y"
2042 { yyval.htag = yystack.l_mark[-2].htag;
2043 if (yyval.htag->comptag != -1) {
2044 yyerror("duplicate comparator type tag"); YYERROR; }
2045 else { yyval.htag->comptag = yystack.l_mark[-1].nval;
2046 yyval.htag->relation = verify_relat(yystack.l_mark[0].sval);
2047 if (yyval.htag->relation==-1)
2048 {YYERROR; /*vr called yyerror()*/ }
2049 } }
2050 break;
2051 case 80:
2052 #line 592 "sieve.y"
2053 { yyval.htag = yystack.l_mark[-2].htag;
2054 if (yyval.htag->comparator != NULL) {
2055 yyerror("duplicate comparator tag"); YYERROR; }
2056 else if (!strcmp(yystack.l_mark[0].sval, "i;ascii-numeric") &&
2057 !parse_script->support.i_ascii_numeric) {
2058 yyerror("comparator-i;ascii-numeric MUST be enabled with \"require\""); YYERROR; }
2059 else {
2060 yyval.htag->comparator = yystack.l_mark[0].sval; } }
2061 break;
2062 case 81:
2063 #line 602 "sieve.y"
2064 { yyval.btag = new_btags(); }
2065 break;
2066 case 82:
2067 #line 603 "sieve.y"
2068 { yyval.btag = yystack.l_mark[-1].btag;
2069 if (yyval.btag->transform != -1) {
2070 yyerror("duplicate or conflicting transform tag");
2071 YYERROR; }
2072 else { yyval.btag->transform = RAW; } }
2073 break;
2074 case 83:
2075 #line 608 "sieve.y"
2076 { yyval.btag = yystack.l_mark[-1].btag;
2077 if (yyval.btag->transform != -1) {
2078 yyerror("duplicate or conflicting transform tag");
2079 YYERROR; }
2080 else { yyval.btag->transform = TEXT; } }
2081 break;
2082 case 84:
2083 #line 613 "sieve.y"
2084 { yyval.btag = yystack.l_mark[-2].btag;
2085 if (yyval.btag->transform != -1) {
2086 yyerror("duplicate or conflicting transform tag");
2087 YYERROR; }
2088 else {
2089 yyval.btag->transform = CONTENT;
2090 yyval.btag->content_types = yystack.l_mark[0].sl;
2091 } }
2092 break;
2093 case 85:
2094 #line 621 "sieve.y"
2095 { yyval.btag = yystack.l_mark[-1].btag;
2096 if (yyval.btag->comptag != -1) {
2097 yyerror("duplicate comparator type tag"); YYERROR; }
2098 else { yyval.btag->comptag = yystack.l_mark[0].nval; } }
2099 break;
2100 case 86:
2101 #line 625 "sieve.y"
2102 { yyval.btag = yystack.l_mark[-2].btag;
2103 if (yyval.btag->comptag != -1) {
2104 yyerror("duplicate comparator type tag"); YYERROR; }
2105 else { yyval.btag->comptag = yystack.l_mark[-1].nval;
2106 yyval.btag->relation = verify_relat(yystack.l_mark[0].sval);
2107 if (yyval.btag->relation==-1)
2108 {YYERROR; /*vr called yyerror()*/ }
2109 } }
2110 break;
2111 case 87:
2112 #line 633 "sieve.y"
2113 { yyval.btag = yystack.l_mark[-2].btag;
2114 if (yyval.btag->comparator != NULL) {
2115 yyerror("duplicate comparator tag"); YYERROR; }
2116 else if (!strcmp(yystack.l_mark[0].sval, "i;ascii-numeric") &&
2117 !parse_script->support.i_ascii_numeric) {
2118 yyerror("comparator-i;ascii-numeric MUST be enabled with \"require\""); YYERROR; }
2119 else {
2120 yyval.btag->comparator = yystack.l_mark[0].sval; } }
2121 break;
2122 case 88:
2123 #line 644 "sieve.y"
2124 { yyval.nval = ALL; }
2125 break;
2126 case 89:
2127 #line 645 "sieve.y"
2128 { yyval.nval = LOCALPART; }
2129 break;
2130 case 90:
2131 #line 646 "sieve.y"
2132 { yyval.nval = DOMAIN; }
2133 break;
2134 case 91:
2135 #line 647 "sieve.y"
2136 { if (!parse_script->support.subaddress) {
2137 yyerror("subaddress MUST be enabled with \"require\"");
2138 YYERROR;
2139 }
2140 yyval.nval = USER; }
2141 break;
2142 case 92:
2143 #line 652 "sieve.y"
2144 { if (!parse_script->support.subaddress) {
2145 yyerror("subaddress MUST be enabled with \"require\"");
2146 YYERROR;
2147 }
2148 yyval.nval = DETAIL; }
2149 break;
2150 case 93:
2151 #line 658 "sieve.y"
2152 { yyval.nval = IS; }
2153 break;
2154 case 94:
2155 #line 659 "sieve.y"
2156 { yyval.nval = CONTAINS; }
2157 break;
2158 case 95:
2159 #line 660 "sieve.y"
2160 { yyval.nval = MATCHES; }
2161 break;
2162 case 96:
2163 #line 661 "sieve.y"
2164 { if (!parse_script->support.regex) {
2165 yyerror("regex MUST be enabled with \"require\"");
2166 YYERROR;
2167 }
2168 yyval.nval = REGEX; }
2169 break;
2170 case 97:
2171 #line 668 "sieve.y"
2172 { if (!parse_script->support.relational) {
2173 yyerror("relational MUST be enabled with \"require\"");
2174 YYERROR;
2175 }
2176 yyval.nval = COUNT; }
2177 break;
2178 case 98:
2179 #line 673 "sieve.y"
2180 { if (!parse_script->support.relational) {
2181 yyerror("relational MUST be enabled with \"require\"");
2182 YYERROR;
2183 }
2184 yyval.nval = VALUE; }
2185 break;
2186 case 99:
2187 #line 681 "sieve.y"
2188 { yyval.nval = OVER; }
2189 break;
2190 case 100:
2191 #line 682 "sieve.y"
2192 { yyval.nval = UNDER; }
2193 break;
2194 case 101:
2195 #line 685 "sieve.y"
2196 { yyval.nval = 0; }
2197 break;
2198 case 102:
2199 #line 686 "sieve.y"
2200 { if (!parse_script->support.copy) {
2201 yyerror("copy MUST be enabled with \"require\"");
2202 YYERROR;
2203 }
2204 yyval.nval = COPY; }
2205 break;
2206 case 103:
2207 #line 693 "sieve.y"
2208 { yyval.testl = yystack.l_mark[-1].testl; }
2209 break;
2210 case 104:
2211 #line 696 "sieve.y"
2212 { yyval.testl = new_testlist(yystack.l_mark[0].test, NULL); }
2213 break;
2214 case 105:
2215 #line 697 "sieve.y"
2216 { yyval.testl = new_testlist(yystack.l_mark[-2].test, yystack.l_mark[0].testl); }
2217 break;
2218 #line 2219 "y.tab.c"
2219 }
2220 yystack.s_mark -= yym;
2221 yystate = *yystack.s_mark;
2222 yystack.l_mark -= yym;
2223 yym = yylhs[yyn];
2224 if (yystate == 0 && yym == 0)
2225 {
2226 #if YYDEBUG
2227 if (yydebug)
2228 printf("%sdebug: after reduction, shifting from state 0 to\
2229 state %d\n", YYPREFIX, YYFINAL);
2230 #endif
2231 yystate = YYFINAL;
2232 *++yystack.s_mark = YYFINAL;
2233 *++yystack.l_mark = yyval;
2234 if (yychar < 0)
2235 {
2236 if ((yychar = YYLEX) < 0) yychar = 0;
2237 #if YYDEBUG
2238 if (yydebug)
2239 {
2240 yys = 0;
2241 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
2242 if (!yys) yys = "illegal-symbol";
2243 printf("%sdebug: state %d, reading %d (%s)\n",
2244 YYPREFIX, YYFINAL, yychar, yys);
2245 }
2246 #endif
2247 }
2248 if (yychar == 0) goto yyaccept;
2249 goto yyloop;
2250 }
2251 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
2252 yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
2253 yystate = yytable[yyn];
2254 else
2255 yystate = yydgoto[yym];
2256 #if YYDEBUG
2257 if (yydebug)
2258 printf("%sdebug: after reduction, shifting from state %d \
2259 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
2260 #endif
2261 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
2262 {
2263 goto yyoverflow;
2264 }
2265 *++yystack.s_mark = (short) yystate;
2266 *++yystack.l_mark = yyval;
2267 goto yyloop;
2268
2269 yyoverflow:
2270 yyerror("yacc stack overflow");
2271
2272 yyabort:
2273 yyfreestack(&yystack);
2274 return (1);
2275
2276 yyaccept:
2277 yyfreestack(&yystack);
2278 return (0);
2279 }
3729
0 #define NUMBER 257
1 #define STRING 258
2 #define IF 259
3 #define ELSIF 260
4 #define ELSE 261
5 #define REJCT 262
6 #define FILEINTO 263
7 #define REDIRECT 264
8 #define KEEP 265
9 #define STOP 266
10 #define DISCARD 267
11 #define VACATION 268
12 #define REQUIRE 269
13 #define SETFLAG 270
14 #define ADDFLAG 271
15 #define REMOVEFLAG 272
16 #define MARK 273
17 #define UNMARK 274
18 #define NOTIFY 275
19 #define DENOTIFY 276
20 #define ANYOF 277
21 #define ALLOF 278
22 #define EXISTS 279
23 #define SFALSE 280
24 #define STRUE 281
25 #define HEADER 282
26 #define NOT 283
27 #define SIZE 284
28 #define ADDRESS 285
29 #define ENVELOPE 286
30 #define BODY 287
31 #define COMPARATOR 288
32 #define IS 289
33 #define CONTAINS 290
34 #define MATCHES 291
35 #define REGEX 292
36 #define COUNT 293
37 #define VALUE 294
38 #define OVER 295
39 #define UNDER 296
40 #define GT 297
41 #define GE 298
42 #define LT 299
43 #define LE 300
44 #define EQ 301
45 #define NE 302
46 #define ALL 303
47 #define LOCALPART 304
48 #define DOMAIN 305
49 #define USER 306
50 #define DETAIL 307
51 #define RAW 308
52 #define TEXT 309
53 #define CONTENT 310
54 #define DAYS 311
55 #define ADDRESSES 312
56 #define SUBJECT 313
57 #define FROM 314
58 #define HANDLE 315
59 #define MIME 316
60 #define METHOD 317
61 #define ID 318
62 #define OPTIONS 319
63 #define LOW 320
64 #define NORMAL 321
65 #define HIGH 322
66 #define ANY 323
67 #define MESSAGE 324
68 #define INCLUDE 325
69 #define PERSONAL 326
70 #define GLOBAL 327
71 #define RETURN 328
72 #define COPY 329
73 typedef union {
0
1 /* A Bison parser, made by GNU Bison 2.4.1. */
2
3 /* Skeleton interface for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34
35 /* Tokens. */
36 #ifndef YYTOKENTYPE
37 # define YYTOKENTYPE
38 /* Put the tokens into the symbol table, so that GDB and other debuggers
39 know about them. */
40 enum yytokentype {
41 NUMBER = 258,
42 STRING = 259,
43 IF = 260,
44 ELSIF = 261,
45 ELSE = 262,
46 REJCT = 263,
47 FILEINTO = 264,
48 REDIRECT = 265,
49 KEEP = 266,
50 STOP = 267,
51 DISCARD = 268,
52 VACATION = 269,
53 REQUIRE = 270,
54 SETFLAG = 271,
55 ADDFLAG = 272,
56 REMOVEFLAG = 273,
57 MARK = 274,
58 UNMARK = 275,
59 NOTIFY = 276,
60 DENOTIFY = 277,
61 ANYOF = 278,
62 ALLOF = 279,
63 EXISTS = 280,
64 SFALSE = 281,
65 STRUE = 282,
66 HEADER = 283,
67 NOT = 284,
68 SIZE = 285,
69 ADDRESS = 286,
70 ENVELOPE = 287,
71 BODY = 288,
72 COMPARATOR = 289,
73 IS = 290,
74 CONTAINS = 291,
75 MATCHES = 292,
76 REGEX = 293,
77 COUNT = 294,
78 VALUE = 295,
79 OVER = 296,
80 UNDER = 297,
81 GT = 298,
82 GE = 299,
83 LT = 300,
84 LE = 301,
85 EQ = 302,
86 NE = 303,
87 ALL = 304,
88 LOCALPART = 305,
89 DOMAIN = 306,
90 USER = 307,
91 DETAIL = 308,
92 RAW = 309,
93 TEXT = 310,
94 CONTENT = 311,
95 DAYS = 312,
96 ADDRESSES = 313,
97 SUBJECT = 314,
98 FROM = 315,
99 HANDLE = 316,
100 MIME = 317,
101 METHOD = 318,
102 ID = 319,
103 OPTIONS = 320,
104 LOW = 321,
105 NORMAL = 322,
106 HIGH = 323,
107 ANY = 324,
108 MESSAGE = 325,
109 INCLUDE = 326,
110 PERSONAL = 327,
111 GLOBAL = 328,
112 RETURN = 329,
113 COPY = 330
114 };
115 #endif
116 /* Tokens. */
117 #define NUMBER 258
118 #define STRING 259
119 #define IF 260
120 #define ELSIF 261
121 #define ELSE 262
122 #define REJCT 263
123 #define FILEINTO 264
124 #define REDIRECT 265
125 #define KEEP 266
126 #define STOP 267
127 #define DISCARD 268
128 #define VACATION 269
129 #define REQUIRE 270
130 #define SETFLAG 271
131 #define ADDFLAG 272
132 #define REMOVEFLAG 273
133 #define MARK 274
134 #define UNMARK 275
135 #define NOTIFY 276
136 #define DENOTIFY 277
137 #define ANYOF 278
138 #define ALLOF 279
139 #define EXISTS 280
140 #define SFALSE 281
141 #define STRUE 282
142 #define HEADER 283
143 #define NOT 284
144 #define SIZE 285
145 #define ADDRESS 286
146 #define ENVELOPE 287
147 #define BODY 288
148 #define COMPARATOR 289
149 #define IS 290
150 #define CONTAINS 291
151 #define MATCHES 292
152 #define REGEX 293
153 #define COUNT 294
154 #define VALUE 295
155 #define OVER 296
156 #define UNDER 297
157 #define GT 298
158 #define GE 299
159 #define LT 300
160 #define LE 301
161 #define EQ 302
162 #define NE 303
163 #define ALL 304
164 #define LOCALPART 305
165 #define DOMAIN 306
166 #define USER 307
167 #define DETAIL 308
168 #define RAW 309
169 #define TEXT 310
170 #define CONTENT 311
171 #define DAYS 312
172 #define ADDRESSES 313
173 #define SUBJECT 314
174 #define FROM 315
175 #define HANDLE 316
176 #define MIME 317
177 #define METHOD 318
178 #define ID 319
179 #define OPTIONS 320
180 #define LOW 321
181 #define NORMAL 322
182 #define HIGH 323
183 #define ANY 324
184 #define MESSAGE 325
185 #define INCLUDE 326
186 #define PERSONAL 327
187 #define GLOBAL 328
188 #define RETURN 329
189 #define COPY 330
190
191
192
193
194 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
195 typedef union YYSTYPE
196 {
197
198 /* Line 1676 of yacc.c */
199 #line 176 "sieve.y"
200
74201 int nval;
75202 char *sval;
76203 stringlist_t *sl;
83210 struct btags *btag;
84211 struct ntags *ntag;
85212 struct dtags *dtag;
213
214
215
216 /* Line 1676 of yacc.c */
217 #line 219 "y.tab.h"
86218 } YYSTYPE;
219 # define YYSTYPE_IS_TRIVIAL 1
220 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
221 # define YYSTYPE_IS_DECLARED 1
222 #endif
223
87224 extern YYSTYPE yylval;
225
226
8282 directory! */
8383
8484 extern int sieved_userisadmin;
85 char *sieve_dir = NULL;
85 static char *sieve_dir_config = NULL;
8686
8787 static const char *sieved_userid = NULL;
8888
9393 sieve_usehomedir = config_getswitch(IMAPOPT_SIEVEUSEHOMEDIR);
9494
9595 if (!sieve_usehomedir) {
96 sieve_dir = (char *) config_getstring(IMAPOPT_SIEVEDIR);
96 sieve_dir_config = (char *) config_getstring(IMAPOPT_SIEVEDIR);
9797 } else {
9898 /* can't use home directories with timsieved */
9999 syslog(LOG_ERR, "can't use home directories");
107107 int actions_setuser(const char *userid)
108108 {
109109 char userbuf[1024], *user, *domain = NULL;
110 char *foo = sieve_dir;
111110 size_t size = 1024, len;
112111 int result;
113112
114 sieve_dir = (char *) xzmalloc(size+1);
113 char *sieve_dir = (char *) xzmalloc(size+1);
115114
116115 sieved_userid = xstrdup(userid);
117116 user = (char *) userid;
122121 if ((domain = strrchr(user, '@'))) *domain++ = '\0';
123122 }
124123
125 len = strlcpy(sieve_dir, foo, size);
124 len = strlcpy(sieve_dir, sieve_dir_config, size);
126125
127126 if (domain) {
128127 char dhash = (char) dir_hash_c(domain, config_fulldirhash);
145144 if (!result) result = chdir(sieve_dir);
146145 if (result) {
147146 syslog(LOG_ERR, "mkdir %s: %m", sieve_dir);
147 free(sieve_dir);
148148 return TIMSIEVE_FAIL;
149149 }
150150 }
151151
152 free(sieve_dir);
152153 return TIMSIEVE_OK;
153154 }
154155
204205 if (tls_enabled() && !starttls_done && !authenticated) {
205206 prot_printf(conn, "\"STARTTLS\"\r\n");
206207 }
208 prot_printf(conn, "\"UNAUTHENTICATE\"\r\n");
207209
208210 prot_printf(conn,"OK\r\n");
209211
232234
233235 result = stat(path, &filestats);
234236 if (result != 0) {
235 prot_printf(conn,"NO \"Script doesn't exist\"\r\n");
237 prot_printf(conn,"NO (NONEXISTENT) \"Script doesn't exist\"\r\n");
236238 return TIMSIEVE_NOEXIST;
237239 }
238240 size = filestats.st_size;
315317 FILE *stream;
316318 char *dataptr;
317319 char *errstr;
318 int lup;
320 int i;
321 int last_was_r = 0;
319322 int result;
320323 char path[1024], p2[1024];
321324 char bc_path[1024], bc_p2[1024];
339342 if (countscripts(string_DATAPTR(name))+1 > maxscripts)
340343 {
341344 prot_printf(conn,
342 "NO (\"QUOTA\") \"You are only allowed %d scripts on this server\"\r\n",
345 "NO (QUOTA/MAXSCRIPTS) \"You are only allowed %d scripts on this server\"\r\n",
343346 maxscripts);
344347 return TIMSIEVE_FAIL;
345348 }
358361
359362 dataptr = string_DATAPTR(data);
360363
361 for (lup=0;lup<= data->len / BLOCKSIZE; lup++) {
362 int amount = BLOCKSIZE;
363
364 if (lup*BLOCKSIZE+BLOCKSIZE > data->len)
365 amount=data->len % BLOCKSIZE;
366
367 fwrite(dataptr, 1, amount, stream);
368
369 dataptr += amount;
370 }
364 /* copy data to file - replacing any lone \r or \n with the
365 * \r\n pair so notify messages are SMTP compatible */
366 for (i = 0; i < data->len; i++) {
367 if (last_was_r) {
368 if (dataptr[i] != '\n')
369 putc('\n', stream);
370 }
371 else {
372 if (dataptr[i] == '\n')
373 putc('\r', stream);
374 }
375 putc(dataptr[i], stream);
376 last_was_r = (dataptr[i] == '\r');
377 }
378 if (last_was_r)
379 putc('\n', stream);
380
371381
372382 /* let's make sure this is a valid script
373383 (no parse errors)
495505
496506 snprintf(path, 1023, "%s.script", string_DATAPTR(name));
497507
498 if (isactive(string_DATAPTR(name)) && (deleteactive(conn)!=TIMSIEVE_OK)) {
499 return TIMSIEVE_FAIL;
508 if (isactive(string_DATAPTR(name))) {
509 prot_printf(conn, "NO (ACTIVE) \"Active script cannot be deleted\"\r\n");
510 return TIMSIEVE_FAIL;
500511 }
501512
502513 result = unlink(path);
503514
504515 if (result != 0) {
505 prot_printf(conn,"NO \"Error deleting script\"\r\n");
516 if (result == ENOENT)
517 prot_printf(conn, "NO (NONEXISTENT) \"Script %s does not exist.\"\r\n", string_DATAPTR(name));
518 else
519 prot_printf(conn,"NO \"Error deleting script\"\r\n");
506520 return TIMSIEVE_FAIL;
507521 }
508522
609623
610624 if (exists(string_DATAPTR(name))==FALSE)
611625 {
612 prot_printf(conn,"NO \"Script does not exist\"\r\n");
626 prot_printf(conn,"NO (NONEXISTENT) \"Script does not exist\"\r\n");
613627 return TIMSIEVE_NOEXIST;
614628 }
615629
666680 if (num > maxscriptsize)
667681 {
668682 prot_printf(conn,
669 "NO (\"QUOTA\") \"Script size is too large. "
683 "NO (QUOTA/MAXSIZE) \"Script size is too large. "
670684 "Max script size is %ld bytes\"\r\n",
671685 maxscriptsize);
672686 return TIMSIEVE_FAIL;
678692 if (countscripts(string_DATAPTR(sieve_name))+1 > maxscripts)
679693 {
680694 prot_printf(conn,
681 "NO (\"QUOTA\") \"You are only allowed %d scripts on this server\"\r\n",
695 "NO (QUOTA/MAXSCRIPTS) \"You are only allowed %d scripts on this server\"\r\n",
682696 maxscripts);
683697 return TIMSIEVE_FAIL;
684698 }
8181 case 'g':
8282 if (strcmp(str, "getscript")==0) return GETSCRIPT;
8383 break;
84
8485 case 'h':
8586 if (strcmp(str, "havespace")==0) return HAVESPACE;
8687 break;
8889 case 'l':
8990 if (strcmp(str, "listscripts")==0) return LISTSCRIPTS;
9091 if (strcmp(str, "logout")==0) return LOGOUT;
92 break;
93
94 case 'n':
95 if (strcmp(str, "noop")==0) return NOOP;
9196 break;
9297
9398 case 'p':
98103 if (strcmp(str, "setactive")==0) return SETACTIVE;
99104 if (strcmp(str, "starttls")==0 && tls_enabled())
100105 return STARTTLS;
106 break;
107
108 case 'u':
109 if (strcmp(str, "unauthenticate")==0) return UNAUTHENTICATE;
101110 break;
102111 }
103112
7979 #define CAPABILITY 407
8080 #define HAVESPACE 408
8181 #define STARTTLS 409
82 #define NOOP 410
83 #define UNAUTHENTICATE 411
8284
8385
8486 int lex_init(void);
100100 struct protstream *sieved_in);
101101 static int cmd_authenticate(struct protstream *sieved_out, struct protstream *sieved_in,
102102 mystring_t *mechanism_name, mystring_t *initial_challenge, const char **errmsg);
103 static void cmd_unauthenticate(struct protstream *sieved_out,
104 struct protstream *sieved_in);
103105 static int cmd_starttls(struct protstream *sieved_out, struct protstream *sieved_in);
104106
105107 static char *sieve_parsesuccess(char *str, const char **status)
151153
152154 if (!authenticated && (token > 255) && (token!=AUTHENTICATE) &&
153155 (token!=LOGOUT) && (token!=CAPABILITY) &&
156 (token!=NOOP) &&
154157 (!tls_enabled() || (token!=STARTTLS)))
155158 {
156159 error_msg = "Authenticate first";
452455 cmd_starttls(sieved_out, sieved_in);
453456
454457 break;
458
459 case NOOP:
460
461 token = timlex(NULL, NULL, sieved_in);
462 mystring_t *noop_param = NULL;
463 if (token != EOL)
464 {
465 /* optional string parameter */
466 if (token!=SPACE)
467 {
468 error_msg = "Expected SPACE";
469 goto error;
470 }
471
472 if (timlex(&noop_param, NULL, sieved_in)!=STRING)
473 {
474 error_msg = "Expected string";
475 free(noop_param);
476 goto error;
477 }
478
479 token = timlex(NULL, NULL, sieved_in);
480 }
481
482 if (token != EOL)
483 {
484 error_msg = "Expected EOL";
485 free(noop_param);
486 goto error;
487 }
488
489 if (noop_param != NULL) {
490 int temp;
491 char* dataptr = string_DATAPTR(noop_param);
492 prot_printf(sieved_out, "OK (TAG {%d}\r\n", noop_param->len);
493 for (temp = 0; temp < noop_param->len; temp++)
494 prot_putc(dataptr[temp], sieved_out);
495 prot_printf(sieved_out, ") \"Done\"\r\n");
496 free(noop_param);
497 } else
498 prot_printf(sieved_out, "OK \"Done\"\r\n");
499 break;
500
501 case UNAUTHENTICATE:
502 if (timlex(NULL, NULL, sieved_in)!=EOL)
503 {
504 error_msg = "Expected EOL";
505 goto error;
506 }
507 cmd_unauthenticate(sieved_out, sieved_in);
508 break;
455509
456510 default:
457511 error_msg="Expected a command. Got something else.";
514568 static char *authid = NULL;
515569
516570 extern int reset_saslconn(sasl_conn_t **conn, sasl_ssf_t ssf, char *authid);
571
572 static void cmd_unauthenticate(struct protstream *sieved_out,
573 struct protstream *sieved_in)
574 {
575 if (chdir("/tmp/"))
576 syslog(LOG_ERR, "Failed to chdir to /tmp/");
577 reset_saslconn(&sieved_saslconn, sieved_in->saslssf, authid);
578 prot_unsetsasl(sieved_out);
579 prot_unsetsasl(sieved_in);
580 prot_printf(sieved_out, "OK\r\n");
581 authenticated = 0;
582 }
517583
518584 static int cmd_authenticate(struct protstream *sieved_out,
519585 struct protstream *sieved_in,
7070 # Look for CC=xxx "assigments" in the argument list.
7171 #
7272 while ($#ARGV >= 0) {
73 last unless ($ARGV[0] =~ m/^(\S+)=(\S+)$/);
73 last unless ($ARGV[0] =~ m/^(\S+)=(.*)$/);
7474 eval "\$$1='$2';";
7575 die "$@" if ($@);
7676 shift @ARGV;
0 /* Release cyrus-imapd-2.4.9 */
1 #define _CYRUS_VERSION "v2.4.9"
2 #define CYRUS_GITVERSION "ebb103d8 2011-06-21"
0 /* Release cyrus-imapd-2.4.11 */
1 #define _CYRUS_VERSION "v2.4.11"
2 #define CYRUS_GITVERSION "e9b02f20 2011-09-08"