Imported Upstream version 2.4.11
Ondřej Surý
12 years ago
63 | 63 | COMPILE_ET = @COMPILE_ET@ |
64 | 64 | |
65 | 65 | PACKAGE = cyrus-imapd |
66 | VERSION = 2.4.9 | |
66 | VERSION = 2.4.11 | |
67 | 67 | GIT_VERSION = $(VERSION).git$(shell date +'%Y%m%d%H%M') |
68 | 68 | |
69 | 69 | all:: xversion |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.67. | |
2 | # Generated by GNU Autoconf 2.68. | |
3 | 3 | # |
4 | 4 | # |
5 | 5 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
88 | 88 | IFS=" "" $as_nl" |
89 | 89 | |
90 | 90 | # Find who we are. Look in the path if we contain no directory separator. |
91 | as_myself= | |
91 | 92 | case $0 in #(( |
92 | 93 | *[\\/]* ) as_myself=$0 ;; |
93 | 94 | *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
213 | 214 | # We cannot yet assume a decent shell, so we have to provide a |
214 | 215 | # neutralization value for shells without unset; and this also |
215 | 216 | # works around shells that cannot unset nonexistent variables. |
217 | # Preserve -v and -x to the replacement shell. | |
216 | 218 | BASH_ENV=/dev/null |
217 | 219 | ENV=/dev/null |
218 | 220 | (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV |
219 | 221 | 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+"$@"} | |
221 | 229 | fi |
222 | 230 | |
223 | 231 | if test x$as_have_required = xno; then : |
1195 | 1203 | $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 |
1196 | 1204 | expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && |
1197 | 1205 | $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}" | |
1199 | 1207 | ;; |
1200 | 1208 | |
1201 | 1209 | esac |
1476 | 1484 | CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if |
1477 | 1485 | you have headers in a nonstandard directory <include dir> |
1478 | 1486 | 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'. | |
1481 | 1490 | YFLAGS The list of arguments that will be passed by default to $YACC. |
1482 | 1491 | This script will default YFLAGS to the empty string to avoid a |
1483 | 1492 | default value of `-d' given by some make applications. |
1549 | 1558 | if $ac_init_version; then |
1550 | 1559 | cat <<\_ACEOF |
1551 | 1560 | configure |
1552 | generated by GNU Autoconf 2.67 | |
1561 | generated by GNU Autoconf 2.68 | |
1553 | 1562 | |
1554 | 1563 | Copyright (C) 2010 Free Software Foundation, Inc. |
1555 | 1564 | This configure script is free software; the Free Software Foundation |
1595 | 1604 | |
1596 | 1605 | ac_retval=1 |
1597 | 1606 | 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 | |
1599 | 1608 | as_fn_set_status $ac_retval |
1600 | 1609 | |
1601 | 1610 | } # ac_fn_c_try_compile |
1632 | 1641 | |
1633 | 1642 | ac_retval=1 |
1634 | 1643 | 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 | |
1636 | 1645 | as_fn_set_status $ac_retval |
1637 | 1646 | |
1638 | 1647 | } # ac_fn_c_try_cpp |
1645 | 1654 | ac_fn_c_check_header_mongrel () |
1646 | 1655 | { |
1647 | 1656 | 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 : | |
1649 | 1658 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
1650 | 1659 | $as_echo_n "checking for $2... " >&6; } |
1651 | if eval "test \"\${$3+set}\"" = set; then : | |
1660 | if eval \${$3+:} false; then : | |
1652 | 1661 | $as_echo_n "(cached) " >&6 |
1653 | 1662 | fi |
1654 | 1663 | eval ac_res=\$$3 |
1711 | 1720 | esac |
1712 | 1721 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
1713 | 1722 | $as_echo_n "checking for $2... " >&6; } |
1714 | if eval "test \"\${$3+set}\"" = set; then : | |
1723 | if eval \${$3+:} false; then : | |
1715 | 1724 | $as_echo_n "(cached) " >&6 |
1716 | 1725 | else |
1717 | 1726 | eval "$3=\$ac_header_compiler" |
1720 | 1729 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
1721 | 1730 | $as_echo "$ac_res" >&6; } |
1722 | 1731 | 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 | |
1724 | 1733 | |
1725 | 1734 | } # ac_fn_c_check_header_mongrel |
1726 | 1735 | |
1761 | 1770 | ac_retval=$ac_status |
1762 | 1771 | fi |
1763 | 1772 | 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 | |
1765 | 1774 | as_fn_set_status $ac_retval |
1766 | 1775 | |
1767 | 1776 | } # ac_fn_c_try_run |
1775 | 1784 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
1776 | 1785 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
1777 | 1786 | $as_echo_n "checking for $2... " >&6; } |
1778 | if eval "test \"\${$3+set}\"" = set; then : | |
1787 | if eval \${$3+:} false; then : | |
1779 | 1788 | $as_echo_n "(cached) " >&6 |
1780 | 1789 | else |
1781 | 1790 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
1793 | 1802 | eval ac_res=\$$3 |
1794 | 1803 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
1795 | 1804 | $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 | |
1797 | 1806 | |
1798 | 1807 | } # ac_fn_c_check_header_compile |
1799 | 1808 | |
1838 | 1847 | # interfere with the next link command; also delete a directory that is |
1839 | 1848 | # left behind by Apple's compiler. We do this before executing the actions. |
1840 | 1849 | 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 | |
1842 | 1851 | as_fn_set_status $ac_retval |
1843 | 1852 | |
1844 | 1853 | } # ac_fn_c_try_link |
2016 | 2025 | rm -f conftest.val |
2017 | 2026 | |
2018 | 2027 | 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 | |
2020 | 2029 | as_fn_set_status $ac_retval |
2021 | 2030 | |
2022 | 2031 | } # ac_fn_c_compute_int |
2029 | 2038 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
2030 | 2039 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
2031 | 2040 | $as_echo_n "checking for $2... " >&6; } |
2032 | if eval "test \"\${$3+set}\"" = set; then : | |
2041 | if eval \${$3+:} false; then : | |
2033 | 2042 | $as_echo_n "(cached) " >&6 |
2034 | 2043 | else |
2035 | 2044 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
2084 | 2093 | eval ac_res=\$$3 |
2085 | 2094 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
2086 | 2095 | $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 | |
2088 | 2097 | |
2089 | 2098 | } # ac_fn_c_check_func |
2090 | 2099 | |
2097 | 2106 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
2098 | 2107 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 |
2099 | 2108 | $as_echo_n "checking for $2.$3... " >&6; } |
2100 | if eval "test \"\${$4+set}\"" = set; then : | |
2109 | if eval \${$4+:} false; then : | |
2101 | 2110 | $as_echo_n "(cached) " >&6 |
2102 | 2111 | else |
2103 | 2112 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
2141 | 2150 | eval ac_res=\$$4 |
2142 | 2151 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
2143 | 2152 | $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 | |
2145 | 2154 | |
2146 | 2155 | } # ac_fn_c_check_member |
2147 | 2156 | |
2156 | 2165 | as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` |
2157 | 2166 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 |
2158 | 2167 | $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 : | |
2160 | 2169 | $as_echo_n "(cached) " >&6 |
2161 | 2170 | else |
2162 | 2171 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
2187 | 2196 | eval ac_res=\$$3 |
2188 | 2197 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
2189 | 2198 | $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 | |
2191 | 2200 | |
2192 | 2201 | } # ac_fn_c_check_decl |
2193 | 2202 | cat >config.log <<_ACEOF |
2195 | 2204 | running configure, to aid debugging if configure makes a mistake. |
2196 | 2205 | |
2197 | 2206 | 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 | |
2199 | 2208 | |
2200 | 2209 | $ $0 $@ |
2201 | 2210 | |
2453 | 2462 | || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
2454 | 2463 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
2455 | 2464 | 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; } | |
2457 | 2466 | fi |
2458 | 2467 | done |
2459 | 2468 | |
2580 | 2589 | |
2581 | 2590 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 |
2582 | 2591 | $as_echo_n "checking build system type... " >&6; } |
2583 | if test "${ac_cv_build+set}" = set; then : | |
2592 | if ${ac_cv_build+:} false; then : | |
2584 | 2593 | $as_echo_n "(cached) " >&6 |
2585 | 2594 | else |
2586 | 2595 | ac_build_alias=$build_alias |
2596 | 2605 | $as_echo "$ac_cv_build" >&6; } |
2597 | 2606 | case $ac_cv_build in |
2598 | 2607 | *-*-*) ;; |
2599 | *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; | |
2608 | *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; | |
2600 | 2609 | esac |
2601 | 2610 | build=$ac_cv_build |
2602 | 2611 | ac_save_IFS=$IFS; IFS='-' |
2614 | 2623 | |
2615 | 2624 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 |
2616 | 2625 | $as_echo_n "checking host system type... " >&6; } |
2617 | if test "${ac_cv_host+set}" = set; then : | |
2626 | if ${ac_cv_host+:} false; then : | |
2618 | 2627 | $as_echo_n "(cached) " >&6 |
2619 | 2628 | else |
2620 | 2629 | if test "x$host_alias" = x; then |
2629 | 2638 | $as_echo "$ac_cv_host" >&6; } |
2630 | 2639 | case $ac_cv_host in |
2631 | 2640 | *-*-*) ;; |
2632 | *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; | |
2641 | *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; | |
2633 | 2642 | esac |
2634 | 2643 | host=$ac_cv_host |
2635 | 2644 | ac_save_IFS=$IFS; IFS='-' |
2647 | 2656 | |
2648 | 2657 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 |
2649 | 2658 | $as_echo_n "checking target system type... " >&6; } |
2650 | if test "${ac_cv_target+set}" = set; then : | |
2659 | if ${ac_cv_target+:} false; then : | |
2651 | 2660 | $as_echo_n "(cached) " >&6 |
2652 | 2661 | else |
2653 | 2662 | if test "x$target_alias" = x; then |
2662 | 2671 | $as_echo "$ac_cv_target" >&6; } |
2663 | 2672 | case $ac_cv_target in |
2664 | 2673 | *-*-*) ;; |
2665 | *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; | |
2674 | *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; | |
2666 | 2675 | esac |
2667 | 2676 | target=$ac_cv_target |
2668 | 2677 | ac_save_IFS=$IFS; IFS='-' |
2701 | 2710 | set dummy makedepend; ac_word=$2 |
2702 | 2711 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
2703 | 2712 | $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 : | |
2705 | 2714 | $as_echo_n "(cached) " >&6 |
2706 | 2715 | else |
2707 | 2716 | if test -n "$MAKEDEPEND"; then |
2819 | 2828 | set dummy ${ac_tool_prefix}gcc; ac_word=$2 |
2820 | 2829 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
2821 | 2830 | $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 : | |
2823 | 2832 | $as_echo_n "(cached) " >&6 |
2824 | 2833 | else |
2825 | 2834 | if test -n "$CC"; then |
2859 | 2868 | set dummy gcc; ac_word=$2 |
2860 | 2869 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
2861 | 2870 | $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 : | |
2863 | 2872 | $as_echo_n "(cached) " >&6 |
2864 | 2873 | else |
2865 | 2874 | if test -n "$ac_ct_CC"; then |
2912 | 2921 | set dummy ${ac_tool_prefix}cc; ac_word=$2 |
2913 | 2922 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
2914 | 2923 | $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 : | |
2916 | 2925 | $as_echo_n "(cached) " >&6 |
2917 | 2926 | else |
2918 | 2927 | if test -n "$CC"; then |
2952 | 2961 | set dummy cc; ac_word=$2 |
2953 | 2962 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
2954 | 2963 | $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 : | |
2956 | 2965 | $as_echo_n "(cached) " >&6 |
2957 | 2966 | else |
2958 | 2967 | if test -n "$CC"; then |
3011 | 3020 | set dummy $ac_tool_prefix$ac_prog; ac_word=$2 |
3012 | 3021 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
3013 | 3022 | $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 : | |
3015 | 3024 | $as_echo_n "(cached) " >&6 |
3016 | 3025 | else |
3017 | 3026 | if test -n "$CC"; then |
3055 | 3064 | set dummy $ac_prog; ac_word=$2 |
3056 | 3065 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
3057 | 3066 | $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 : | |
3059 | 3068 | $as_echo_n "(cached) " >&6 |
3060 | 3069 | else |
3061 | 3070 | if test -n "$ac_ct_CC"; then |
3110 | 3119 | test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
3111 | 3120 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
3112 | 3121 | 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; } | |
3114 | 3123 | |
3115 | 3124 | # Provide some information about the compiler. |
3116 | 3125 | $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 |
3225 | 3234 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
3226 | 3235 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
3227 | 3236 | 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; } | |
3229 | 3238 | else |
3230 | 3239 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
3231 | 3240 | $as_echo "yes" >&6; } |
3268 | 3277 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
3269 | 3278 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
3270 | 3279 | 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; } | |
3272 | 3281 | fi |
3273 | 3282 | rm -f conftest conftest$ac_cv_exeext |
3274 | 3283 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 |
3327 | 3336 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
3328 | 3337 | as_fn_error $? "cannot run C compiled programs. |
3329 | 3338 | 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; } | |
3331 | 3340 | fi |
3332 | 3341 | fi |
3333 | 3342 | fi |
3338 | 3347 | ac_clean_files=$ac_clean_files_save |
3339 | 3348 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 |
3340 | 3349 | $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 : | |
3342 | 3351 | $as_echo_n "(cached) " >&6 |
3343 | 3352 | else |
3344 | 3353 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
3379 | 3388 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
3380 | 3389 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
3381 | 3390 | 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; } | |
3383 | 3392 | fi |
3384 | 3393 | rm -f conftest.$ac_cv_objext conftest.$ac_ext |
3385 | 3394 | fi |
3389 | 3398 | ac_objext=$OBJEXT |
3390 | 3399 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 |
3391 | 3400 | $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 : | |
3393 | 3402 | $as_echo_n "(cached) " >&6 |
3394 | 3403 | else |
3395 | 3404 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
3426 | 3435 | ac_save_CFLAGS=$CFLAGS |
3427 | 3436 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 |
3428 | 3437 | $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 : | |
3430 | 3439 | $as_echo_n "(cached) " >&6 |
3431 | 3440 | else |
3432 | 3441 | ac_save_c_werror_flag=$ac_c_werror_flag |
3504 | 3513 | fi |
3505 | 3514 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 |
3506 | 3515 | $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 : | |
3508 | 3517 | $as_echo_n "(cached) " >&6 |
3509 | 3518 | else |
3510 | 3519 | ac_cv_prog_cc_c89=no |
3604 | 3613 | set dummy ${ac_tool_prefix}ranlib; ac_word=$2 |
3605 | 3614 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
3606 | 3615 | $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 : | |
3608 | 3617 | $as_echo_n "(cached) " >&6 |
3609 | 3618 | else |
3610 | 3619 | if test -n "$RANLIB"; then |
3644 | 3653 | set dummy ranlib; ac_word=$2 |
3645 | 3654 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
3646 | 3655 | $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 : | |
3648 | 3657 | $as_echo_n "(cached) " >&6 |
3649 | 3658 | else |
3650 | 3659 | if test -n "$ac_ct_RANLIB"; then |
3695 | 3704 | $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } |
3696 | 3705 | set x ${MAKE-make} |
3697 | 3706 | 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 : | |
3699 | 3708 | $as_echo_n "(cached) " >&6 |
3700 | 3709 | else |
3701 | 3710 | cat >conftest.make <<\_ACEOF |
3739 | 3748 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 |
3740 | 3749 | $as_echo_n "checking for a BSD-compatible install... " >&6; } |
3741 | 3750 | if test -z "$INSTALL"; then |
3742 | if test "${ac_cv_path_install+set}" = set; then : | |
3751 | if ${ac_cv_path_install+:} false; then : | |
3743 | 3752 | $as_echo_n "(cached) " >&6 |
3744 | 3753 | else |
3745 | 3754 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
3828 | 3837 | CPP= |
3829 | 3838 | fi |
3830 | 3839 | if test -z "$CPP"; then |
3831 | if test "${ac_cv_prog_CPP+set}" = set; then : | |
3840 | if ${ac_cv_prog_CPP+:} false; then : | |
3832 | 3841 | $as_echo_n "(cached) " >&6 |
3833 | 3842 | else |
3834 | 3843 | # Double quotes because CPP needs to be expanded |
3944 | 3953 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
3945 | 3954 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
3946 | 3955 | 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; } | |
3948 | 3957 | fi |
3949 | 3958 | |
3950 | 3959 | ac_ext=c |
3956 | 3965 | |
3957 | 3966 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 |
3958 | 3967 | $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 : | |
3960 | 3969 | $as_echo_n "(cached) " >&6 |
3961 | 3970 | else |
3962 | 3971 | if test -z "$GREP"; then |
4019 | 4028 | |
4020 | 4029 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 |
4021 | 4030 | $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 : | |
4023 | 4032 | $as_echo_n "(cached) " >&6 |
4024 | 4033 | else |
4025 | 4034 | if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 |
4086 | 4095 | |
4087 | 4096 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 |
4088 | 4097 | $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 : | |
4090 | 4099 | $as_echo_n "(cached) " >&6 |
4091 | 4100 | else |
4092 | 4101 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
4215 | 4224 | |
4216 | 4225 | |
4217 | 4226 | 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 : | |
4219 | 4228 | MINIX=yes |
4220 | 4229 | else |
4221 | 4230 | MINIX= |
4237 | 4246 | |
4238 | 4247 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 |
4239 | 4248 | $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 : | |
4241 | 4250 | $as_echo_n "(cached) " >&6 |
4242 | 4251 | else |
4243 | 4252 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
4277 | 4286 | |
4278 | 4287 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 |
4279 | 4288 | $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 : | |
4281 | 4290 | $as_echo_n "(cached) " >&6 |
4282 | 4291 | else |
4283 | 4292 | ac_func_search_save_LIBS=$LIBS |
4311 | 4320 | fi |
4312 | 4321 | rm -f core conftest.err conftest.$ac_objext \ |
4313 | 4322 | conftest$ac_exeext |
4314 | if test "${ac_cv_search_strerror+set}" = set; then : | |
4323 | if ${ac_cv_search_strerror+:} false; then : | |
4315 | 4324 | break |
4316 | 4325 | fi |
4317 | 4326 | done |
4318 | if test "${ac_cv_search_strerror+set}" = set; then : | |
4327 | if ${ac_cv_search_strerror+:} false; then : | |
4319 | 4328 | |
4320 | 4329 | else |
4321 | 4330 | ac_cv_search_strerror=no |
4337 | 4346 | set dummy $ac_prog; ac_word=$2 |
4338 | 4347 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
4339 | 4348 | $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 : | |
4341 | 4350 | $as_echo_n "(cached) " >&6 |
4342 | 4351 | else |
4343 | 4352 | if test -n "$AWK"; then |
4375 | 4384 | |
4376 | 4385 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 |
4377 | 4386 | $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 : | |
4379 | 4388 | $as_echo_n "(cached) " >&6 |
4380 | 4389 | else |
4381 | 4390 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
4455 | 4464 | |
4456 | 4465 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long file names" >&5 |
4457 | 4466 | $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 : | |
4459 | 4468 | $as_echo_n "(cached) " >&6 |
4460 | 4469 | else |
4461 | 4470 | ac_cv_sys_long_file_names=yes |
4498 | 4507 | fi |
4499 | 4508 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 |
4500 | 4509 | $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 : | |
4502 | 4511 | $as_echo_n "(cached) " >&6 |
4503 | 4512 | else |
4504 | 4513 | ac_cv_c_inline=no |
4545 | 4554 | # This bug is HP SR number 8606223364. |
4546 | 4555 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 |
4547 | 4556 | $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 : | |
4549 | 4558 | $as_echo_n "(cached) " >&6 |
4550 | 4559 | else |
4551 | 4560 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : |
4555 | 4564 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
4556 | 4565 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
4557 | 4566 | 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; } | |
4559 | 4568 | else |
4560 | 4569 | ac_cv_sizeof_int=0 |
4561 | 4570 | fi |
4578 | 4587 | # This bug is HP SR number 8606223364. |
4579 | 4588 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 |
4580 | 4589 | $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 : | |
4582 | 4591 | $as_echo_n "(cached) " >&6 |
4583 | 4592 | else |
4584 | 4593 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : |
4588 | 4597 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
4589 | 4598 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
4590 | 4599 | 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; } | |
4592 | 4601 | else |
4593 | 4602 | ac_cv_sizeof_long=0 |
4594 | 4603 | fi |
4611 | 4620 | # This bug is HP SR number 8606223364. |
4612 | 4621 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 |
4613 | 4622 | $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 : | |
4615 | 4624 | $as_echo_n "(cached) " >&6 |
4616 | 4625 | else |
4617 | 4626 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : |
4621 | 4630 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
4622 | 4631 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
4623 | 4632 | 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; } | |
4625 | 4634 | else |
4626 | 4635 | ac_cv_sizeof_size_t=0 |
4627 | 4636 | fi |
4644 | 4653 | # This bug is HP SR number 8606223364. |
4645 | 4654 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 |
4646 | 4655 | $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 : | |
4648 | 4657 | $as_echo_n "(cached) " >&6 |
4649 | 4658 | else |
4650 | 4659 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : |
4654 | 4663 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
4655 | 4664 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
4656 | 4665 | 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; } | |
4658 | 4667 | else |
4659 | 4668 | ac_cv_sizeof_off_t=0 |
4660 | 4669 | fi |
4678 | 4687 | # This bug is HP SR number 8606223364. |
4679 | 4688 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5 |
4680 | 4689 | $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 : | |
4682 | 4691 | $as_echo_n "(cached) " >&6 |
4683 | 4692 | else |
4684 | 4693 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then : |
4688 | 4697 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
4689 | 4698 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
4690 | 4699 | 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; } | |
4692 | 4701 | else |
4693 | 4702 | ac_cv_sizeof_long_long_int=0 |
4694 | 4703 | fi |
4711 | 4720 | # This bug is HP SR number 8606223364. |
4712 | 4721 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long int" >&5 |
4713 | 4722 | $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 : | |
4715 | 4724 | $as_echo_n "(cached) " >&6 |
4716 | 4725 | else |
4717 | 4726 | 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 : |
4721 | 4730 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
4722 | 4731 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
4723 | 4732 | 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; } | |
4725 | 4734 | else |
4726 | 4735 | ac_cv_sizeof_unsigned_long_long_int=0 |
4727 | 4736 | fi |
4745 | 4754 | |
4746 | 4755 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 |
4747 | 4756 | $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 : | |
4749 | 4758 | $as_echo_n "(cached) " >&6 |
4750 | 4759 | else |
4751 | 4760 | ac_cv_c_bigendian=unknown |
4964 | 4973 | ;; #( |
4965 | 4974 | *) |
4966 | 4975 | 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 ;; | |
4968 | 4977 | esac |
4969 | 4978 | |
4970 | 4979 | fi |
4972 | 4981 | |
4973 | 4982 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__" >&5 |
4974 | 4983 | $as_echo_n "checking for __attribute__... " >&6; } |
4975 | if test "${ac_cv___attribute__+set}" = set; then : | |
4984 | if ${ac_cv___attribute__+:} false; then : | |
4976 | 4985 | $as_echo_n "(cached) " >&6 |
4977 | 4986 | else |
4978 | 4987 | |
5016 | 5025 | |
5017 | 5026 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -fPIC" >&5 |
5018 | 5027 | $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 : | |
5020 | 5029 | $as_echo_n "(cached) " >&6 |
5021 | 5030 | else |
5022 | 5031 | |
5064 | 5073 | # CMU GUESS RUNPATH SWITCH |
5065 | 5074 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for runpath switch" >&5 |
5066 | 5075 | $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 : | |
5068 | 5077 | $as_echo_n "(cached) " >&6 |
5069 | 5078 | else |
5070 | 5079 | |
5129 | 5138 | done |
5130 | 5139 | |
5131 | 5140 | 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 : | |
5133 | 5142 | $as_echo "#define HAVE_MEMMOVE 1" >>confdefs.h |
5134 | 5143 | |
5135 | 5144 | else |
5142 | 5151 | fi |
5143 | 5152 | |
5144 | 5153 | 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 : | |
5146 | 5155 | $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h |
5147 | 5156 | |
5148 | 5157 | else |
5155 | 5164 | fi |
5156 | 5165 | |
5157 | 5166 | 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 : | |
5159 | 5168 | $as_echo "#define HAVE_FTRUNCATE 1" >>confdefs.h |
5160 | 5169 | |
5161 | 5170 | else |
5168 | 5177 | fi |
5169 | 5178 | |
5170 | 5179 | 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 : | |
5172 | 5181 | $as_echo "#define HAVE_STRERROR 1" >>confdefs.h |
5173 | 5182 | |
5174 | 5183 | else |
5198 | 5207 | as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` |
5199 | 5208 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 |
5200 | 5209 | $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 : | |
5202 | 5211 | $as_echo_n "(cached) " >&6 |
5203 | 5212 | else |
5204 | 5213 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5238 | 5247 | if test $ac_header_dirent = dirent.h; then |
5239 | 5248 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 |
5240 | 5249 | $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 : | |
5242 | 5251 | $as_echo_n "(cached) " >&6 |
5243 | 5252 | else |
5244 | 5253 | ac_func_search_save_LIBS=$LIBS |
5272 | 5281 | fi |
5273 | 5282 | rm -f core conftest.err conftest.$ac_objext \ |
5274 | 5283 | conftest$ac_exeext |
5275 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5284 | if ${ac_cv_search_opendir+:} false; then : | |
5276 | 5285 | break |
5277 | 5286 | fi |
5278 | 5287 | done |
5279 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5288 | if ${ac_cv_search_opendir+:} false; then : | |
5280 | 5289 | |
5281 | 5290 | else |
5282 | 5291 | ac_cv_search_opendir=no |
5295 | 5304 | else |
5296 | 5305 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 |
5297 | 5306 | $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 : | |
5299 | 5308 | $as_echo_n "(cached) " >&6 |
5300 | 5309 | else |
5301 | 5310 | ac_func_search_save_LIBS=$LIBS |
5329 | 5338 | fi |
5330 | 5339 | rm -f core conftest.err conftest.$ac_objext \ |
5331 | 5340 | conftest$ac_exeext |
5332 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5341 | if ${ac_cv_search_opendir+:} false; then : | |
5333 | 5342 | break |
5334 | 5343 | fi |
5335 | 5344 | done |
5336 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5345 | if ${ac_cv_search_opendir+:} false; then : | |
5337 | 5346 | |
5338 | 5347 | else |
5339 | 5348 | ac_cv_search_opendir=no |
5355 | 5364 | for ac_header in stdlib.h |
5356 | 5365 | do : |
5357 | 5366 | 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 : | |
5359 | 5368 | cat >>confdefs.h <<_ACEOF |
5360 | 5369 | #define HAVE_STDLIB_H 1 |
5361 | 5370 | _ACEOF |
5367 | 5376 | for ac_func in getpassphrase |
5368 | 5377 | do : |
5369 | 5378 | 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 : | |
5371 | 5380 | cat >>confdefs.h <<_ACEOF |
5372 | 5381 | #define HAVE_GETPASSPHRASE 1 |
5373 | 5382 | _ACEOF |
5380 | 5389 | save_LIBS="$LIBS" |
5381 | 5390 | LIB_SOCKET="" |
5382 | 5391 | 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 : | |
5384 | 5393 | : |
5385 | 5394 | else |
5386 | 5395 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 |
5387 | 5396 | $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 : | |
5389 | 5398 | $as_echo_n "(cached) " >&6 |
5390 | 5399 | else |
5391 | 5400 | ac_check_lib_save_LIBS=$LIBS |
5419 | 5428 | fi |
5420 | 5429 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 |
5421 | 5430 | $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 : | |
5423 | 5432 | LIB_SOCKET="-lnsl $LIB_SOCKET" |
5424 | 5433 | fi |
5425 | 5434 | |
5426 | 5435 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 |
5427 | 5436 | $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 : | |
5429 | 5438 | $as_echo_n "(cached) " >&6 |
5430 | 5439 | else |
5431 | 5440 | ac_check_lib_save_LIBS=$LIBS |
5459 | 5468 | fi |
5460 | 5469 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 |
5461 | 5470 | $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 : | |
5463 | 5472 | LIB_SOCKET="-lsocket $LIB_SOCKET" |
5464 | 5473 | fi |
5465 | 5474 | |
5468 | 5477 | |
5469 | 5478 | LIBS="$LIB_SOCKET $save_LIBS" |
5470 | 5479 | 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 : | |
5472 | 5481 | : |
5473 | 5482 | else |
5474 | 5483 | LIBS="-lresolv $LIB_SOCKET $save_LIBS" |
5524 | 5533 | cyrus_cv_getaddrinfo=yes |
5525 | 5534 | |
5526 | 5535 | 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 : | |
5528 | 5537 | ac_cv_lib_socket_getaddrinfo=no |
5529 | 5538 | ac_cv_lib_inet6_getaddrinfo=no |
5530 | 5539 | |
5531 | 5540 | else |
5532 | 5541 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lsocket" >&5 |
5533 | 5542 | $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 : | |
5535 | 5544 | $as_echo_n "(cached) " >&6 |
5536 | 5545 | else |
5537 | 5546 | ac_check_lib_save_LIBS=$LIBS |
5565 | 5574 | fi |
5566 | 5575 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getaddrinfo" >&5 |
5567 | 5576 | $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 : | |
5569 | 5578 | LIBS="$LIBS -lsocket" |
5570 | 5579 | ac_cv_lib_inet6_getaddrinfo=no |
5571 | 5580 | |
5572 | 5581 | else |
5573 | 5582 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system has IPv6 directory" >&5 |
5574 | 5583 | $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 : | |
5576 | 5585 | $as_echo_n "(cached) " >&6 |
5577 | 5586 | else |
5578 | 5587 | for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do |
5593 | 5602 | fi |
5594 | 5603 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -linet6" >&5 |
5595 | 5604 | $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 : | |
5597 | 5606 | $as_echo_n "(cached) " >&6 |
5598 | 5607 | else |
5599 | 5608 | ac_check_lib_save_LIBS=$LIBS |
5627 | 5636 | fi |
5628 | 5637 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet6_getaddrinfo" >&5 |
5629 | 5638 | $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 : | |
5631 | 5640 | if test $ipv6_libinet6 = no; then |
5632 | 5641 | ipv6_libinet6=yes |
5633 | 5642 | LIBS="$LIBS -linet6" |
5678 | 5687 | if test $ipv6_cv_getaddrinfo = yes; then |
5679 | 5688 | |
5680 | 5689 | 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 : | |
5682 | 5691 | ac_cv_lib_socket_gai_strerror=no |
5683 | 5692 | ac_cv_lib_inet6_gai_strerror=no |
5684 | 5693 | |
5685 | 5694 | else |
5686 | 5695 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gai_strerror in -lsocket" >&5 |
5687 | 5696 | $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 : | |
5689 | 5698 | $as_echo_n "(cached) " >&6 |
5690 | 5699 | else |
5691 | 5700 | ac_check_lib_save_LIBS=$LIBS |
5719 | 5728 | fi |
5720 | 5729 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gai_strerror" >&5 |
5721 | 5730 | $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 : | |
5723 | 5732 | LIBS="$LIBS -lsocket" |
5724 | 5733 | ac_cv_lib_inet6_gai_strerror=no |
5725 | 5734 | |
5726 | 5735 | else |
5727 | 5736 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system has IPv6 directory" >&5 |
5728 | 5737 | $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 : | |
5730 | 5739 | $as_echo_n "(cached) " >&6 |
5731 | 5740 | else |
5732 | 5741 | for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do |
5747 | 5756 | fi |
5748 | 5757 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gai_strerror in -linet6" >&5 |
5749 | 5758 | $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 : | |
5751 | 5760 | $as_echo_n "(cached) " >&6 |
5752 | 5761 | else |
5753 | 5762 | ac_check_lib_save_LIBS=$LIBS |
5781 | 5790 | fi |
5782 | 5791 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet6_gai_strerror" >&5 |
5783 | 5792 | $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 : | |
5785 | 5794 | if test $ipv6_libinet6 = no; then |
5786 | 5795 | ipv6_libinet6=yes |
5787 | 5796 | LIBS="$LIBS -linet6" |
5847 | 5856 | cyrus_cv_getnameinfo=yes |
5848 | 5857 | |
5849 | 5858 | 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 : | |
5851 | 5860 | ac_cv_lib_socket_getnameinfo=no |
5852 | 5861 | ac_cv_lib_inet6_getnameinfo=no |
5853 | 5862 | |
5854 | 5863 | else |
5855 | 5864 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lsocket" >&5 |
5856 | 5865 | $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 : | |
5858 | 5867 | $as_echo_n "(cached) " >&6 |
5859 | 5868 | else |
5860 | 5869 | ac_check_lib_save_LIBS=$LIBS |
5888 | 5897 | fi |
5889 | 5898 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getnameinfo" >&5 |
5890 | 5899 | $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 : | |
5892 | 5901 | LIBS="$LIBS -lsocket" |
5893 | 5902 | ac_cv_lib_inet6_getnameinfo=no |
5894 | 5903 | |
5895 | 5904 | else |
5896 | 5905 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system has IPv6 directory" >&5 |
5897 | 5906 | $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 : | |
5899 | 5908 | $as_echo_n "(cached) " >&6 |
5900 | 5909 | else |
5901 | 5910 | for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do |
5916 | 5925 | fi |
5917 | 5926 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -linet6" >&5 |
5918 | 5927 | $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 : | |
5920 | 5929 | $as_echo_n "(cached) " >&6 |
5921 | 5930 | else |
5922 | 5931 | ac_check_lib_save_LIBS=$LIBS |
5950 | 5959 | fi |
5951 | 5960 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet6_getnameinfo" >&5 |
5952 | 5961 | $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 : | |
5954 | 5963 | if test $ipv6_libinet6 = no; then |
5955 | 5964 | ipv6_libinet6=yes |
5956 | 5965 | LIBS="$LIBS -linet6" |
6013 | 6022 | |
6014 | 6023 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether you have ss_family in struct sockaddr_storage" >&5 |
6015 | 6024 | $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 : | |
6017 | 6026 | $as_echo_n "(cached) " >&6 |
6018 | 6027 | else |
6019 | 6028 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6047 | 6056 | |
6048 | 6057 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether you have sa_len in struct sockaddr" >&5 |
6049 | 6058 | $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 : | |
6051 | 6060 | $as_echo_n "(cached) " >&6 |
6052 | 6061 | else |
6053 | 6062 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6084 | 6093 | for ac_header in sys/time.h |
6085 | 6094 | do : |
6086 | 6095 | 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 : | |
6088 | 6097 | cat >>confdefs.h <<_ACEOF |
6089 | 6098 | #define HAVE_SYS_TIME_H 1 |
6090 | 6099 | _ACEOF |
6095 | 6104 | |
6096 | 6105 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 |
6097 | 6106 | $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 : | |
6099 | 6108 | $as_echo_n "(cached) " >&6 |
6100 | 6109 | else |
6101 | 6110 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6130 | 6139 | |
6131 | 6140 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 |
6132 | 6141 | $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 : | |
6134 | 6143 | $as_echo_n "(cached) " >&6 |
6135 | 6144 | else |
6136 | 6145 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6167 | 6176 | #include <$ac_cv_struct_tm> |
6168 | 6177 | |
6169 | 6178 | " |
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 : | |
6171 | 6180 | |
6172 | 6181 | cat >>confdefs.h <<_ACEOF |
6173 | 6182 | #define HAVE_STRUCT_TM_TM_ZONE 1 |
6183 | 6192 | else |
6184 | 6193 | ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h> |
6185 | 6194 | " |
6186 | if test "x$ac_cv_have_decl_tzname" = x""yes; then : | |
6195 | if test "x$ac_cv_have_decl_tzname" = xyes; then : | |
6187 | 6196 | ac_have_decl=1 |
6188 | 6197 | else |
6189 | 6198 | ac_have_decl=0 |
6195 | 6204 | |
6196 | 6205 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 |
6197 | 6206 | $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 : | |
6199 | 6208 | $as_echo_n "(cached) " >&6 |
6200 | 6209 | else |
6201 | 6210 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6239 | 6248 | for ac_func in vprintf |
6240 | 6249 | do : |
6241 | 6250 | 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 : | |
6243 | 6252 | cat >>confdefs.h <<_ACEOF |
6244 | 6253 | #define HAVE_VPRINTF 1 |
6245 | 6254 | _ACEOF |
6246 | 6255 | |
6247 | 6256 | 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 : | |
6249 | 6258 | |
6250 | 6259 | $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h |
6251 | 6260 | |
6325 | 6334 | fi |
6326 | 6335 | |
6327 | 6336 | 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 : | |
6329 | 6338 | |
6330 | 6339 | BDB_SAVE_LDFLAGS=$LDFLAGS |
6331 | 6340 | |
6517 | 6526 | fi |
6518 | 6527 | |
6519 | 6528 | 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 : | |
6521 | 6530 | |
6522 | 6531 | MYSQL_SAVE_LDFLAGS=$LDFLAGS |
6523 | 6532 | |
6666 | 6675 | fi |
6667 | 6676 | |
6668 | 6677 | 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 : | |
6670 | 6679 | |
6671 | 6680 | PGSQL_SAVE_LDFLAGS=$LDFLAGS |
6672 | 6681 | |
6815 | 6824 | fi |
6816 | 6825 | |
6817 | 6826 | 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 : | |
6819 | 6828 | |
6820 | 6829 | SQLITE_SAVE_LDFLAGS=$LDFLAGS |
6821 | 6830 | |
6949 | 6958 | set dummy $ac_prog; ac_word=$2 |
6950 | 6959 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
6951 | 6960 | $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 : | |
6953 | 6962 | $as_echo_n "(cached) " >&6 |
6954 | 6963 | else |
6955 | 6964 | if test -n "$YACC"; then |
6992 | 7001 | set dummy $ac_prog; ac_word=$2 |
6993 | 7002 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
6994 | 7003 | $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 : | |
6996 | 7005 | $as_echo_n "(cached) " >&6 |
6997 | 7006 | else |
6998 | 7007 | if test -n "$LEX"; then |
7062 | 7071 | test $ac_status = 0; } |
7063 | 7072 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 |
7064 | 7073 | $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 : | |
7066 | 7075 | $as_echo_n "(cached) " >&6 |
7067 | 7076 | else |
7068 | 7077 | |
7081 | 7090 | if test -z "${LEXLIB+set}"; then |
7082 | 7091 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 |
7083 | 7092 | $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 : | |
7085 | 7094 | $as_echo_n "(cached) " >&6 |
7086 | 7095 | else |
7087 | 7096 | |
7111 | 7120 | |
7112 | 7121 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 |
7113 | 7122 | $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 : | |
7115 | 7124 | $as_echo_n "(cached) " >&6 |
7116 | 7125 | else |
7117 | 7126 | # POSIX says lex can declare yytext either as a pointer or an array; the |
7122 | 7131 | LIBS="$LEXLIB $ac_save_LIBS" |
7123 | 7132 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7124 | 7133 | /* end confdefs.h. */ |
7125 | #define YYTEXT_POINTER 1 | |
7134 | ||
7135 | #define YYTEXT_POINTER 1 | |
7126 | 7136 | `cat $LEX_OUTPUT_ROOT.c` |
7127 | 7137 | _ACEOF |
7128 | 7138 | if ac_fn_c_try_link "$LINENO"; then : |
7145 | 7155 | fi |
7146 | 7156 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lfl" >&5 |
7147 | 7157 | $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 : | |
7149 | 7159 | $as_echo_n "(cached) " >&6 |
7150 | 7160 | else |
7151 | 7161 | ac_check_lib_save_LIBS=$LIBS |
7173 | 7183 | fi |
7174 | 7184 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fl_main" >&5 |
7175 | 7185 | $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 : | |
7177 | 7187 | cat >>confdefs.h <<_ACEOF |
7178 | 7188 | #define HAVE_LIBFL 1 |
7179 | 7189 | _ACEOF |
7185 | 7195 | |
7186 | 7196 | if test "$testpcre" != "no"; then |
7187 | 7197 | 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 : | |
7189 | 7199 | |
7190 | 7200 | fi |
7191 | 7201 | |
7193 | 7203 | if test "$ac_cv_header_pcreposix_h" == "yes"; then |
7194 | 7204 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for utf8 enabled pcre" >&5 |
7195 | 7205 | $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 : | |
7197 | 7207 | $as_echo_n "(cached) " >&6 |
7198 | 7208 | else |
7199 | 7209 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7230 | 7240 | for ac_header in rxposix.h |
7231 | 7241 | do : |
7232 | 7242 | 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 : | |
7234 | 7244 | cat >>confdefs.h <<_ACEOF |
7235 | 7245 | #define HAVE_RXPOSIX_H 1 |
7236 | 7246 | _ACEOF |
7247 | 7257 | else |
7248 | 7258 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing regcomp" >&5 |
7249 | 7259 | $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 : | |
7251 | 7261 | $as_echo_n "(cached) " >&6 |
7252 | 7262 | else |
7253 | 7263 | ac_func_search_save_LIBS=$LIBS |
7281 | 7291 | fi |
7282 | 7292 | rm -f core conftest.err conftest.$ac_objext \ |
7283 | 7293 | conftest$ac_exeext |
7284 | if test "${ac_cv_search_regcomp+set}" = set; then : | |
7294 | if ${ac_cv_search_regcomp+:} false; then : | |
7285 | 7295 | break |
7286 | 7296 | fi |
7287 | 7297 | done |
7288 | if test "${ac_cv_search_regcomp+set}" = set; then : | |
7298 | if ${ac_cv_search_regcomp+:} false; then : | |
7289 | 7299 | |
7290 | 7300 | else |
7291 | 7301 | ac_cv_search_regcomp=no |
7313 | 7323 | |
7314 | 7324 | |
7315 | 7325 | 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 : | |
7317 | 7327 | |
7318 | 7328 | $as_echo "#define HAS_STRERROR /**/" >>confdefs.h |
7319 | 7329 | |
7327 | 7337 | for ac_header in sys/resource.h |
7328 | 7338 | do : |
7329 | 7339 | 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 : | |
7331 | 7341 | cat >>confdefs.h <<_ACEOF |
7332 | 7342 | #define HAVE_SYS_RESOURCE_H 1 |
7333 | 7343 | _ACEOF |
7339 | 7349 | for ac_func in setrlimit |
7340 | 7350 | do : |
7341 | 7351 | 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 : | |
7343 | 7353 | cat >>confdefs.h <<_ACEOF |
7344 | 7354 | #define HAVE_SETRLIMIT 1 |
7345 | 7355 | _ACEOF |
7350 | 7360 | for ac_func in getrlimit |
7351 | 7361 | do : |
7352 | 7362 | 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 : | |
7354 | 7364 | cat >>confdefs.h <<_ACEOF |
7355 | 7365 | #define HAVE_GETRLIMIT 1 |
7356 | 7366 | _ACEOF |
7375 | 7385 | for ac_func in shutdown |
7376 | 7386 | do : |
7377 | 7387 | 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 : | |
7379 | 7389 | cat >>confdefs.h <<_ACEOF |
7380 | 7390 | #define HAVE_SHUTDOWN 1 |
7381 | 7391 | _ACEOF |
7426 | 7436 | |
7427 | 7437 | spt_type="" |
7428 | 7438 | 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 : | |
7430 | 7440 | spt_type=SPT_BUILTIN |
7431 | 7441 | fi |
7432 | 7442 | |
7433 | 7443 | if test "$spt_type" = ""; then |
7434 | 7444 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setproctitle in -lutil" >&5 |
7435 | 7445 | $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 : | |
7437 | 7447 | $as_echo_n "(cached) " >&6 |
7438 | 7448 | else |
7439 | 7449 | ac_check_lib_save_LIBS=$LIBS |
7467 | 7477 | fi |
7468 | 7478 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_setproctitle" >&5 |
7469 | 7479 | $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 : | |
7471 | 7481 | spt_type=SPT_BUILTIN |
7472 | 7482 | LIBS="${LIBS} -lutil" |
7473 | 7483 | fi |
7475 | 7485 | fi |
7476 | 7486 | if test "$spt_type" = ""; then |
7477 | 7487 | 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 : | |
7479 | 7489 | spt_type=SPT_PSTAT |
7480 | 7490 | fi |
7481 | 7491 | |
7483 | 7493 | fi |
7484 | 7494 | if test "$spt_type" = ""; then |
7485 | 7495 | 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 : | |
7487 | 7497 | spt_type=SPT_SYSMIPS |
7488 | 7498 | fi |
7489 | 7499 | |
7492 | 7502 | if test "$spt_type" = ""; then |
7493 | 7503 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5 |
7494 | 7504 | $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 : | |
7496 | 7506 | $as_echo_n "(cached) " >&6 |
7497 | 7507 | else |
7498 | 7508 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7521 | 7531 | if test "$spt_type" = ""; then |
7522 | 7532 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SCO" >&5 |
7523 | 7533 | $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 : | |
7525 | 7535 | $as_echo_n "(cached) " >&6 |
7526 | 7536 | else |
7527 | 7537 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7548 | 7558 | if test "$spt_type" = ""; then |
7549 | 7559 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setproctitle usability" >&5 |
7550 | 7560 | $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 : | |
7552 | 7562 | $as_echo_n "(cached) " >&6 |
7553 | 7563 | else |
7554 | 7564 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7582 | 7592 | |
7583 | 7593 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking nonblocking method" >&5 |
7584 | 7594 | $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 : | |
7586 | 7596 | $as_echo_n "(cached) " >&6 |
7587 | 7597 | else |
7588 | 7598 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7617 | 7627 | |
7618 | 7628 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking timezone GMT offset method" >&5 |
7619 | 7629 | $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 : | |
7621 | 7631 | $as_echo_n "(cached) " >&6 |
7622 | 7632 | else |
7623 | 7633 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7648 | 7658 | $as_echo "$WITH_GMTOFF" >&6; } |
7649 | 7659 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared mmap" >&5 |
7650 | 7660 | $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 : | |
7652 | 7662 | $as_echo_n "(cached) " >&6 |
7653 | 7663 | else |
7654 | 7664 | if test "$cross_compiling" = yes; then : |
7700 | 7710 | else |
7701 | 7711 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stupid shared mmap" >&5 |
7702 | 7712 | $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 : | |
7704 | 7714 | $as_echo_n "(cached) " >&6 |
7705 | 7715 | else |
7706 | 7716 | if test "$cross_compiling" = yes; then : |
7767 | 7777 | else |
7768 | 7778 | |
7769 | 7779 | 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 : | |
7771 | 7781 | WITH_LOCK="fcntl" |
7772 | 7782 | else |
7773 | 7783 | |
7774 | 7784 | 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 : | |
7776 | 7786 | WITH_LOCK="flock" |
7777 | 7787 | else |
7778 | 7788 | |
7791 | 7801 | |
7792 | 7802 | LIB_RT="" |
7793 | 7803 | 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 : | |
7795 | 7805 | |
7796 | 7806 | $as_echo "#define HAVE_FDATASYNC /**/" >>confdefs.h |
7797 | 7807 | |
7799 | 7809 | |
7800 | 7810 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fdatasync in -lrt" >&5 |
7801 | 7811 | $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 : | |
7803 | 7813 | $as_echo_n "(cached) " >&6 |
7804 | 7814 | else |
7805 | 7815 | ac_check_lib_save_LIBS=$LIBS |
7833 | 7843 | fi |
7834 | 7844 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_fdatasync" >&5 |
7835 | 7845 | $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 : | |
7837 | 7847 | |
7838 | 7848 | LIB_RT="-lrt" |
7839 | 7849 | |
7847 | 7857 | |
7848 | 7858 | |
7849 | 7859 | cant_find_sigvec=no |
7850 | if test "${cyrus_cv_sigveclib+set}" = set; then : | |
7860 | if ${cyrus_cv_sigveclib+:} false; then : | |
7851 | 7861 | $as_echo_n "(cached) " >&6 |
7852 | 7862 | else |
7853 | 7863 | |
7854 | 7864 | 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 : | |
7856 | 7866 | |
7857 | 7867 | cyrus_cv_sigveclib="" |
7858 | 7868 | |
7860 | 7870 | |
7861 | 7871 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigvec in -lBSD" >&5 |
7862 | 7872 | $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 : | |
7864 | 7874 | $as_echo_n "(cached) " >&6 |
7865 | 7875 | else |
7866 | 7876 | ac_check_lib_save_LIBS=$LIBS |
7894 | 7904 | fi |
7895 | 7905 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_BSD_sigvec" >&5 |
7896 | 7906 | $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 : | |
7898 | 7908 | cyrus_cv_sigveclib="-lBSD" |
7899 | 7909 | else |
7900 | 7910 | |
7902 | 7912 | LDFLAGS="-L/usr/ucblib -R/usr/ucblib $LDFLAGS" |
7903 | 7913 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigvec in -lucb" >&5 |
7904 | 7914 | $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 : | |
7906 | 7916 | $as_echo_n "(cached) " >&6 |
7907 | 7917 | else |
7908 | 7918 | ac_check_lib_save_LIBS=$LIBS |
7936 | 7946 | fi |
7937 | 7947 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ucb_sigvec" >&5 |
7938 | 7948 | $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 : | |
7940 | 7950 | |
7941 | 7951 | cyrus_cv_sigveclib="-lc -L/usr/ucblib -R/usr/ucblib -lucb" |
7942 | 7952 | else |
8028 | 8038 | AFS_LIBS="$AFS_LIBS -ldes" |
8029 | 8039 | fi |
8030 | 8040 | |
8031 | if test "${cyrus_cv_afs_sigvec+set}" = set; then : | |
8041 | if ${cyrus_cv_afs_sigvec+:} false; then : | |
8032 | 8042 | $as_echo_n "(cached) " >&6 |
8033 | 8043 | else |
8034 | 8044 | |
8108 | 8118 | |
8109 | 8119 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap" >&5 |
8110 | 8120 | $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 : | |
8112 | 8122 | $as_echo_n "(cached) " >&6 |
8113 | 8123 | else |
8114 | 8124 | ac_check_lib_save_LIBS=$LIBS |
8142 | 8152 | fi |
8143 | 8153 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_initialize" >&5 |
8144 | 8154 | $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 : | |
8146 | 8156 | |
8147 | 8157 | $as_echo "#define HAVE_LDAP /**/" >>confdefs.h |
8148 | 8158 | |
8158 | 8168 | |
8159 | 8169 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap" >&5 |
8160 | 8170 | $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 : | |
8162 | 8172 | $as_echo_n "(cached) " >&6 |
8163 | 8173 | else |
8164 | 8174 | ac_check_lib_save_LIBS=$LIBS |
8192 | 8202 | fi |
8193 | 8203 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_initialize" >&5 |
8194 | 8204 | $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 : | |
8196 | 8206 | |
8197 | 8207 | $as_echo "#define HAVE_LDAP /**/" >>confdefs.h |
8198 | 8208 | |
8258 | 8268 | |
8259 | 8269 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5 |
8260 | 8270 | $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 : | |
8262 | 8272 | $as_echo_n "(cached) " >&6 |
8263 | 8273 | else |
8264 | 8274 | ac_check_lib_save_LIBS=$LIBS |
8292 | 8302 | fi |
8293 | 8303 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5 |
8294 | 8304 | $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 : | |
8296 | 8306 | cat >>confdefs.h <<_ACEOF |
8297 | 8307 | #define HAVE_LIBRESOLV 1 |
8298 | 8308 | _ACEOF |
8318 | 8328 | if test "$with_krbdes" = "yes"; then |
8319 | 8329 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_ecb_encrypt in -ldes" >&5 |
8320 | 8330 | $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 : | |
8322 | 8332 | $as_echo_n "(cached) " >&6 |
8323 | 8333 | else |
8324 | 8334 | ac_check_lib_save_LIBS=$LIBS |
8352 | 8362 | fi |
8353 | 8363 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des_des_ecb_encrypt" >&5 |
8354 | 8364 | $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 : | |
8356 | 8366 | if test "$with_statickrb" = "yes"; then |
8357 | 8367 | KRB_LIBS="$with_krb/lib/libdes.a" |
8358 | 8368 | else |
8368 | 8378 | if test -d ${with_krb}; then |
8369 | 8379 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kerberos includes" >&5 |
8370 | 8380 | $as_echo_n "checking for Kerberos includes... " >&6; } |
8371 | if test "${cyrus_cv_krbinclude+set}" = set; then : | |
8381 | if ${cyrus_cv_krbinclude+:} false; then : | |
8372 | 8382 | $as_echo_n "(cached) " >&6 |
8373 | 8383 | else |
8374 | 8384 | |
8405 | 8415 | |
8406 | 8416 | if test "$with_des" != no; then |
8407 | 8417 | 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 : | |
8409 | 8419 | as_ac_Lib=`$as_echo "ac_cv_lib_${KRBLIB}''_krb_mk_priv" | $as_tr_sh` |
8410 | 8420 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_mk_priv in -l${KRBLIB}" >&5 |
8411 | 8421 | $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 : | |
8413 | 8423 | $as_echo_n "(cached) " >&6 |
8414 | 8424 | else |
8415 | 8425 | ac_check_lib_save_LIBS=$LIBS |
8494 | 8504 | LIB_RSAREF="" |
8495 | 8505 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RSAPublicEncrypt in -lrsaref" >&5 |
8496 | 8506 | $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 : | |
8498 | 8508 | $as_echo_n "(cached) " >&6 |
8499 | 8509 | else |
8500 | 8510 | ac_check_lib_save_LIBS=$LIBS |
8528 | 8538 | fi |
8529 | 8539 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rsaref_RSAPublicEncrypt" >&5 |
8530 | 8540 | $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 : | |
8532 | 8542 | LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes |
8533 | 8543 | else |
8534 | 8544 | cmu_have_rsaref=no |
8538 | 8548 | with_openssl="yes" |
8539 | 8549 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIO_accept in -lcrypto" >&5 |
8540 | 8550 | $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 : | |
8542 | 8552 | $as_echo_n "(cached) " >&6 |
8543 | 8553 | else |
8544 | 8554 | ac_check_lib_save_LIBS=$LIBS |
8572 | 8582 | fi |
8573 | 8583 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_BIO_accept" >&5 |
8574 | 8584 | $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 : | |
8576 | 8586 | LIBS="-lcrypto $LIB_RSAREF ${LIBS}" |
8577 | 8587 | else |
8578 | 8588 | with_openssl="no" |
8580 | 8590 | |
8581 | 8591 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5 |
8582 | 8592 | $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 : | |
8584 | 8594 | $as_echo_n "(cached) " >&6 |
8585 | 8595 | else |
8586 | 8596 | ac_check_lib_save_LIBS=$LIBS |
8614 | 8624 | fi |
8615 | 8625 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5 |
8616 | 8626 | $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 : | |
8618 | 8628 | LIBS="-lssl ${LIBS}" |
8619 | 8629 | else |
8620 | 8630 | with_openssl="no" |
8694 | 8704 | # This bug is HP SR number 8606223364. |
8695 | 8705 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 |
8696 | 8706 | $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 : | |
8698 | 8708 | $as_echo_n "(cached) " >&6 |
8699 | 8709 | else |
8700 | 8710 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : |
8704 | 8714 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
8705 | 8715 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
8706 | 8716 | 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; } | |
8708 | 8718 | else |
8709 | 8719 | ac_cv_sizeof_long=0 |
8710 | 8720 | fi |
8723 | 8733 | |
8724 | 8734 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking what directory libraries are found in" >&5 |
8725 | 8735 | $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 : | |
8727 | 8737 | $as_echo_n "(cached) " >&6 |
8728 | 8738 | else |
8729 | 8739 | test "X$with_lib_subdir" = "Xyes" && with_lib_subdir= |
8777 | 8787 | with_zlib="no";; |
8778 | 8788 | *) |
8779 | 8789 | 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 : | |
8781 | 8791 | |
8782 | 8792 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 |
8783 | 8793 | $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 : | |
8785 | 8795 | $as_echo_n "(cached) " >&6 |
8786 | 8796 | else |
8787 | 8797 | ac_check_lib_save_LIBS=$LIBS |
8815 | 8825 | fi |
8816 | 8826 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 |
8817 | 8827 | $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 : | |
8819 | 8829 | LIBS="${LIBS} -lz"; with_zlib="yes" |
8820 | 8830 | else |
8821 | 8831 | with_zlib="no" |
8864 | 8874 | no) true;; |
8865 | 8875 | ""|yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZInitialize in -lzephyr" >&5 |
8866 | 8876 | $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 : | |
8868 | 8878 | $as_echo_n "(cached) " >&6 |
8869 | 8879 | else |
8870 | 8880 | ac_check_lib_save_LIBS=$LIBS |
8898 | 8908 | fi |
8899 | 8909 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zephyr_ZInitialize" >&5 |
8900 | 8910 | $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 : | |
8902 | 8912 | ZEPHYR_LIBS="-lzephyr" |
8903 | 8913 | else |
8904 | 8914 | with_zephyr="no" |
8965 | 8975 | for ac_header in sys/sockio.h |
8966 | 8976 | do : |
8967 | 8977 | 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 : | |
8969 | 8979 | cat >>confdefs.h <<_ACEOF |
8970 | 8980 | #define HAVE_SYS_SOCKIO_H 1 |
8971 | 8981 | _ACEOF |
8998 | 9008 | # no value supplied |
8999 | 9009 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for com_err in -lcom_err" >&5 |
9000 | 9010 | $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 : | |
9002 | 9012 | $as_echo_n "(cached) " >&6 |
9003 | 9013 | else |
9004 | 9014 | ac_check_lib_save_LIBS=$LIBS |
9032 | 9042 | fi |
9033 | 9043 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_com_err_com_err" >&5 |
9034 | 9044 | $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 : | |
9036 | 9046 | |
9037 | 9047 | # com_err is already in library path |
9038 | 9048 | # guess we're okay |
9039 | 9049 | # can use system com_err |
9040 | 9050 | with_com_err="" |
9041 | 9051 | 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 : | |
9043 | 9053 | |
9044 | 9054 | $as_echo "#define HAVE_ET_COM_ERR_H /**/" >>confdefs.h |
9045 | 9055 | |
9046 | 9056 | else |
9047 | 9057 | 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 : | |
9049 | 9059 | |
9050 | 9060 | else |
9051 | 9061 | as_fn_error $? "cannot locate com_err.h" "$LINENO" 5 |
9059 | 9069 | set dummy compile_et; ac_word=$2 |
9060 | 9070 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
9061 | 9071 | $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 : | |
9063 | 9073 | $as_echo_n "(cached) " >&6 |
9064 | 9074 | else |
9065 | 9075 | case $COMPILE_ET in |
9105 | 9115 | set dummy /usr/local/bin/compile_et; ac_word=$2 |
9106 | 9116 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
9107 | 9117 | $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 : | |
9109 | 9119 | $as_echo_n "(cached) " >&6 |
9110 | 9120 | else |
9111 | 9121 | case $COMPILE_ET in |
9148 | 9158 | set dummy /usr/bin/compile_et; ac_word=$2 |
9149 | 9159 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
9150 | 9160 | $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 : | |
9152 | 9162 | $as_echo_n "(cached) " >&6 |
9153 | 9163 | else |
9154 | 9164 | case $COMPILE_ET in |
9241 | 9251 | |
9242 | 9252 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for modern syslog" >&5 |
9243 | 9253 | $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 : | |
9245 | 9255 | $as_echo_n "(cached) " >&6 |
9246 | 9256 | else |
9247 | 9257 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9288 | 9298 | $as_echo "$SYSLOG_FACILITY" >&6; } |
9289 | 9299 | |
9290 | 9300 | 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 : | |
9292 | 9302 | $as_echo "#define HAVE_GETDTABLESIZE 1" >>confdefs.h |
9293 | 9303 | |
9294 | 9304 | else |
9341 | 9351 | |
9342 | 9352 | |
9343 | 9353 | 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 : | |
9345 | 9355 | |
9346 | 9356 | else |
9347 | 9357 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 |
9348 | 9358 | $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 : | |
9350 | 9360 | $as_echo_n "(cached) " >&6 |
9351 | 9361 | else |
9352 | 9362 | ac_check_lib_save_LIBS=$LIBS |
9380 | 9390 | fi |
9381 | 9391 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 |
9382 | 9392 | $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 : | |
9384 | 9394 | cat >>confdefs.h <<_ACEOF |
9385 | 9395 | #define HAVE_LIBDL 1 |
9386 | 9396 | _ACEOF |
9392 | 9402 | fi |
9393 | 9403 | |
9394 | 9404 | 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 : | |
9396 | 9406 | cmu_have_crypt=yes |
9397 | 9407 | else |
9398 | 9408 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 |
9399 | 9409 | $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 : | |
9401 | 9411 | $as_echo_n "(cached) " >&6 |
9402 | 9412 | else |
9403 | 9413 | ac_check_lib_save_LIBS=$LIBS |
9431 | 9441 | fi |
9432 | 9442 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 |
9433 | 9443 | $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 : | |
9435 | 9445 | LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes |
9436 | 9446 | else |
9437 | 9447 | cmu_have_crypt=no |
9508 | 9518 | fi |
9509 | 9519 | fi |
9510 | 9520 | 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 : | |
9512 | 9522 | |
9513 | 9523 | else |
9514 | 9524 | 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 : | |
9516 | 9526 | |
9517 | 9527 | else |
9518 | 9528 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling GSSAPI - no include files found" >&5 |
9545 | 9555 | |
9546 | 9556 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5 |
9547 | 9557 | $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 : | |
9549 | 9559 | $as_echo_n "(cached) " >&6 |
9550 | 9560 | else |
9551 | 9561 | ac_check_lib_save_LIBS=$LIBS |
9579 | 9589 | fi |
9580 | 9590 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5 |
9581 | 9591 | $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 : | |
9583 | 9593 | cat >>confdefs.h <<_ACEOF |
9584 | 9594 | #define HAVE_LIBRESOLV 1 |
9585 | 9595 | _ACEOF |
9607 | 9617 | gss_failed=0 |
9608 | 9618 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_unwrap in -lgssapi" >&5 |
9609 | 9619 | $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 : | |
9611 | 9621 | $as_echo_n "(cached) " >&6 |
9612 | 9622 | else |
9613 | 9623 | ac_check_lib_save_LIBS=$LIBS |
9641 | 9651 | fi |
9642 | 9652 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gssapi_gss_unwrap" >&5 |
9643 | 9653 | $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 : | |
9645 | 9655 | gss_impl="heimdal" |
9646 | 9656 | else |
9647 | 9657 | gss_failed=1 |
9656 | 9666 | # check for libkrb5support first |
9657 | 9667 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5int_getspecific in -lkrb5support" >&5 |
9658 | 9668 | $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 : | |
9660 | 9670 | $as_echo_n "(cached) " >&6 |
9661 | 9671 | else |
9662 | 9672 | ac_check_lib_save_LIBS=$LIBS |
9690 | 9700 | fi |
9691 | 9701 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5support_krb5int_getspecific" >&5 |
9692 | 9702 | $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 : | |
9694 | 9704 | K5SUP=-lkrb5support K5SUPSTATIC=$gssapi_dir/libkrb5support.a |
9695 | 9705 | fi |
9696 | 9706 | |
9698 | 9708 | gss_failed=0 |
9699 | 9709 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_unwrap in -lgssapi_krb5" >&5 |
9700 | 9710 | $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 : | |
9702 | 9712 | $as_echo_n "(cached) " >&6 |
9703 | 9713 | else |
9704 | 9714 | ac_check_lib_save_LIBS=$LIBS |
9732 | 9742 | fi |
9733 | 9743 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gssapi_krb5_gss_unwrap" >&5 |
9734 | 9744 | $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 : | |
9736 | 9746 | gss_impl="mit" |
9737 | 9747 | else |
9738 | 9748 | gss_failed=1 |
9765 | 9775 | unset ac_cv_lib_gss_csf_gss_acq_user |
9766 | 9776 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for csf_gss_acq_user in -lgss" >&5 |
9767 | 9777 | $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 : | |
9769 | 9779 | $as_echo_n "(cached) " >&6 |
9770 | 9780 | else |
9771 | 9781 | ac_check_lib_save_LIBS=$LIBS |
9799 | 9809 | fi |
9800 | 9810 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gss_csf_gss_acq_user" >&5 |
9801 | 9811 | $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 : | |
9803 | 9813 | gss_impl="cybersafe03" |
9804 | 9814 | else |
9805 | 9815 | unset ac_cv_lib_gss_csf_gss_acq_user; |
9806 | 9816 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for csf_gss_acq_user in -lgss" >&5 |
9807 | 9817 | $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 : | |
9809 | 9819 | $as_echo_n "(cached) " >&6 |
9810 | 9820 | else |
9811 | 9821 | ac_check_lib_save_LIBS=$LIBS |
9839 | 9849 | fi |
9840 | 9850 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gss_csf_gss_acq_user" >&5 |
9841 | 9851 | $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 : | |
9843 | 9853 | gss_impl="cybersafe" |
9844 | 9854 | else |
9845 | 9855 | gss_failed=1 |
9863 | 9873 | gss_failed=0 |
9864 | 9874 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_unwrap in -lgss" >&5 |
9865 | 9875 | $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 : | |
9867 | 9877 | $as_echo_n "(cached) " >&6 |
9868 | 9878 | else |
9869 | 9879 | ac_check_lib_save_LIBS=$LIBS |
9897 | 9907 | fi |
9898 | 9908 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gss_gss_unwrap" >&5 |
9899 | 9909 | $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 : | |
9901 | 9911 | gss_impl="seam" |
9902 | 9912 | else |
9903 | 9913 | gss_failed=1 |
10058 | 10068 | $as_echo "with implementation ${gss_impl}" >&6; } |
10059 | 10069 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5 |
10060 | 10070 | $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 : | |
10062 | 10072 | $as_echo_n "(cached) " >&6 |
10063 | 10073 | else |
10064 | 10074 | ac_check_lib_save_LIBS=$LIBS |
10092 | 10102 | fi |
10093 | 10103 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5 |
10094 | 10104 | $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 : | |
10096 | 10106 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv" |
10097 | 10107 | fi |
10098 | 10108 | |
10105 | 10115 | for ac_func in gsskrb5_register_acceptor_identity |
10106 | 10116 | do : |
10107 | 10117 | 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 : | |
10109 | 10119 | cat >>confdefs.h <<_ACEOF |
10110 | 10120 | #define HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY 1 |
10111 | 10121 | _ACEOF |
10170 | 10180 | fi |
10171 | 10181 | |
10172 | 10182 | 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 : | |
10174 | 10184 | 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 : | |
10176 | 10186 | for i42 in lib64 lib; do |
10177 | 10187 | if test -r ${with_staticsasl}/$i42/libsasl2.a; then |
10178 | 10188 | ac_cv_found_sasl=yes |
10226 | 10236 | |
10227 | 10237 | # be sure to check for a SASLv2 specific function |
10228 | 10238 | 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 : | |
10230 | 10240 | 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 : | |
10232 | 10242 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prop_get in -lsasl2" >&5 |
10233 | 10243 | $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 : | |
10235 | 10245 | $as_echo_n "(cached) " >&6 |
10236 | 10246 | else |
10237 | 10247 | ac_check_lib_save_LIBS=$LIBS |
10265 | 10275 | fi |
10266 | 10276 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_prop_get" >&5 |
10267 | 10277 | $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 : | |
10269 | 10279 | ac_cv_found_sasl=yes |
10270 | 10280 | else |
10271 | 10281 | ac_cv_found_sasl=no |
10365 | 10375 | |
10366 | 10376 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sasl_checkapop in -lsasl2" >&5 |
10367 | 10377 | $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 : | |
10369 | 10379 | $as_echo_n "(cached) " >&6 |
10370 | 10380 | else |
10371 | 10381 | ac_check_lib_save_LIBS=$LIBS |
10399 | 10409 | fi |
10400 | 10410 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_sasl_checkapop" >&5 |
10401 | 10411 | $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 : | |
10403 | 10413 | |
10404 | 10414 | $as_echo "#define HAVE_APOP /**/" >>confdefs.h |
10405 | 10415 | |
10435 | 10445 | set dummy $ac_prog; ac_word=$2 |
10436 | 10446 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
10437 | 10447 | $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 : | |
10439 | 10449 | $as_echo_n "(cached) " >&6 |
10440 | 10450 | else |
10441 | 10451 | if test -n "$PERL"; then |
10482 | 10492 | PERL_SUBDIRS="imap" |
10483 | 10493 | PERL="${with_perl}" |
10484 | 10494 | case "${target_os}" in |
10485 | linux*|netbsd*) | |
10495 | linux*|netbsd*|freebsd*|dragonfly*) | |
10486 | 10496 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl cccdlflags needed on \"${target_os}\"" >&5 |
10487 | 10497 | $as_echo_n "checking for perl cccdlflags needed on \"${target_os}\"... " >&6; } |
10488 | 10498 | eval `${PERL} -V:cccdlflags` |
10530 | 10540 | cmu_save_LIBS="$LIBS" |
10531 | 10541 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for request_init in -lwrap" >&5 |
10532 | 10542 | $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 : | |
10534 | 10544 | $as_echo_n "(cached) " >&6 |
10535 | 10545 | else |
10536 | 10546 | ac_check_lib_save_LIBS=$LIBS |
10564 | 10574 | fi |
10565 | 10575 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wrap_request_init" >&5 |
10566 | 10576 | $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 : | |
10568 | 10578 | |
10569 | 10579 | 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 : | |
10571 | 10581 | |
10572 | 10582 | else |
10573 | 10583 | with_libwrap=no |
10592 | 10602 | LIB_WRAP="-lwrap" |
10593 | 10603 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yp_get_default_domain in -lnsl" >&5 |
10594 | 10604 | $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 : | |
10596 | 10606 | $as_echo_n "(cached) " >&6 |
10597 | 10607 | else |
10598 | 10608 | ac_check_lib_save_LIBS=$LIBS |
10626 | 10636 | fi |
10627 | 10637 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_yp_get_default_domain" >&5 |
10628 | 10638 | $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 : | |
10630 | 10640 | LIB_WRAP="${LIB_WRAP} -lnsl" |
10631 | 10641 | fi |
10632 | 10642 | |
10659 | 10669 | set dummy net-snmp-config; ac_word=$2 |
10660 | 10670 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
10661 | 10671 | $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 : | |
10663 | 10673 | $as_echo_n "(cached) " >&6 |
10664 | 10674 | else |
10665 | 10675 | case $SNMP_CONFIG in |
10719 | 10729 | for ac_header in net-snmp/agent/agent_module_config.h |
10720 | 10730 | do : |
10721 | 10731 | 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 : | |
10723 | 10733 | cat >>confdefs.h <<_ACEOF |
10724 | 10734 | #define HAVE_NET_SNMP_AGENT_AGENT_MODULE_CONFIG_H 1 |
10725 | 10735 | _ACEOF |
10743 | 10753 | cmu_save_LIBS="$LIBS" |
10744 | 10754 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sprint_objid in -lsnmp" >&5 |
10745 | 10755 | $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 : | |
10747 | 10757 | $as_echo_n "(cached) " >&6 |
10748 | 10758 | else |
10749 | 10759 | ac_check_lib_save_LIBS=$LIBS |
10777 | 10787 | fi |
10778 | 10788 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_snmp_sprint_objid" >&5 |
10779 | 10789 | $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 : | |
10781 | 10791 | |
10782 | 10792 | 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 : | |
10784 | 10794 | |
10785 | 10795 | else |
10786 | 10796 | with_snmp=no |
10805 | 10815 | LIB_UCDSNMP="-lucdagent -lucdmibs -lsnmp" |
10806 | 10816 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpmdbOpen in -lrpm" >&5 |
10807 | 10817 | $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 : | |
10809 | 10819 | $as_echo_n "(cached) " >&6 |
10810 | 10820 | else |
10811 | 10821 | ac_check_lib_save_LIBS=$LIBS |
10839 | 10849 | fi |
10840 | 10850 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpm_rpmdbOpen" >&5 |
10841 | 10851 | $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 : | |
10843 | 10853 | LIB_UCDSNMP="${LIB_UCDSNMP} -lrpm -lpopt" |
10844 | 10854 | fi |
10845 | 10855 | |
10961 | 10971 | :end' >>confcache |
10962 | 10972 | if diff "$cache_file" confcache >/dev/null 2>&1; then :; else |
10963 | 10973 | if test -w "$cache_file"; then |
10964 | test "x$cache_file" != "x/dev/null" && | |
10974 | if test "x$cache_file" != "x/dev/null"; then | |
10965 | 10975 | { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 |
10966 | 10976 | $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 | |
10968 | 10989 | else |
10969 | 10990 | { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 |
10970 | 10991 | $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} |
10997 | 11018 | |
10998 | 11019 | |
10999 | 11020 | |
11000 | : ${CONFIG_STATUS=./config.status} | |
11021 | : "${CONFIG_STATUS=./config.status}" | |
11001 | 11022 | ac_write_fail=0 |
11002 | 11023 | ac_clean_files_save=$ac_clean_files |
11003 | 11024 | ac_clean_files="$ac_clean_files $CONFIG_STATUS" |
11098 | 11119 | IFS=" "" $as_nl" |
11099 | 11120 | |
11100 | 11121 | # Find who we are. Look in the path if we contain no directory separator. |
11122 | as_myself= | |
11101 | 11123 | case $0 in #(( |
11102 | 11124 | *[\\/]* ) as_myself=$0 ;; |
11103 | 11125 | *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
11405 | 11427 | # values after options handling. |
11406 | 11428 | ac_log=" |
11407 | 11429 | 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 | |
11409 | 11431 | |
11410 | 11432 | CONFIG_FILES = $CONFIG_FILES |
11411 | 11433 | CONFIG_HEADERS = $CONFIG_HEADERS |
11467 | 11489 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
11468 | 11490 | ac_cs_version="\\ |
11469 | 11491 | config.status |
11470 | configured by $0, generated by GNU Autoconf 2.67, | |
11492 | configured by $0, generated by GNU Autoconf 2.68, | |
11471 | 11493 | with options \\"\$ac_cs_config\\" |
11472 | 11494 | |
11473 | 11495 | Copyright (C) 2010 Free Software Foundation, Inc. |
11600 | 11622 | "$EXTRA_OUTPUT") CONFIG_FILES="$CONFIG_FILES $EXTRA_OUTPUT" ;; |
11601 | 11623 | "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; |
11602 | 11624 | |
11603 | *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; | |
11625 | *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; | |
11604 | 11626 | esac |
11605 | 11627 | done |
11606 | 11628 | |
11622 | 11644 | # after its creation but before its name has been assigned to `$tmp'. |
11623 | 11645 | $debug || |
11624 | 11646 | { |
11625 | tmp= | |
11647 | tmp= ac_tmp= | |
11626 | 11648 | 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 | |
11628 | 11651 | ' 0 |
11629 | 11652 | trap 'as_fn_exit 1' 1 2 13 15 |
11630 | 11653 | } |
11632 | 11655 | |
11633 | 11656 | { |
11634 | 11657 | tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && |
11635 | test -n "$tmp" && test -d "$tmp" | |
11658 | test -d "$tmp" | |
11636 | 11659 | } || |
11637 | 11660 | { |
11638 | 11661 | tmp=./conf$$-$RANDOM |
11639 | 11662 | (umask 077 && mkdir "$tmp") |
11640 | 11663 | } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 |
11664 | ac_tmp=$tmp | |
11641 | 11665 | |
11642 | 11666 | # Set up the scripts for CONFIG_FILES section. |
11643 | 11667 | # No need to generate them if there are no CONFIG_FILES. |
11659 | 11683 | ac_cs_awk_cr=$ac_cr |
11660 | 11684 | fi |
11661 | 11685 | |
11662 | echo 'BEGIN {' >"$tmp/subs1.awk" && | |
11686 | echo 'BEGIN {' >"$ac_tmp/subs1.awk" && | |
11663 | 11687 | _ACEOF |
11664 | 11688 | |
11665 | 11689 | |
11687 | 11711 | rm -f conf$$subs.sh |
11688 | 11712 | |
11689 | 11713 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
11690 | cat >>"\$tmp/subs1.awk" <<\\_ACAWK && | |
11714 | cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && | |
11691 | 11715 | _ACEOF |
11692 | 11716 | sed -n ' |
11693 | 11717 | h |
11735 | 11759 | rm -f conf$$subs.awk |
11736 | 11760 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
11737 | 11761 | _ACAWK |
11738 | cat >>"\$tmp/subs1.awk" <<_ACAWK && | |
11762 | cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && | |
11739 | 11763 | for (key in S) S_is_set[key] = 1 |
11740 | 11764 | FS = "" |
11741 | 11765 | |
11767 | 11791 | sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" |
11768 | 11792 | else |
11769 | 11793 | cat |
11770 | fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ | |
11794 | fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ | |
11771 | 11795 | || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 |
11772 | 11796 | _ACEOF |
11773 | 11797 | |
11801 | 11825 | # No need to generate them if there are no CONFIG_HEADERS. |
11802 | 11826 | # This happens for instance with `./config.status Makefile'. |
11803 | 11827 | if test -n "$CONFIG_HEADERS"; then |
11804 | cat >"$tmp/defines.awk" <<\_ACAWK || | |
11828 | cat >"$ac_tmp/defines.awk" <<\_ACAWK || | |
11805 | 11829 | BEGIN { |
11806 | 11830 | _ACEOF |
11807 | 11831 | |
11813 | 11837 | # handling of long lines. |
11814 | 11838 | ac_delim='%!_!# ' |
11815 | 11839 | 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 | |
11818 | 11842 | break |
11819 | 11843 | elif $ac_last_try; then |
11820 | 11844 | as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 |
11915 | 11939 | esac |
11916 | 11940 | case $ac_mode$ac_tag in |
11917 | 11941 | :[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;; | |
11919 | 11943 | :[FH]-) ac_tag=-:-;; |
11920 | 11944 | :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; |
11921 | 11945 | esac |
11934 | 11958 | for ac_f |
11935 | 11959 | do |
11936 | 11960 | case $ac_f in |
11937 | -) ac_f="$tmp/stdin";; | |
11961 | -) ac_f="$ac_tmp/stdin";; | |
11938 | 11962 | *) # Look for the file first in the build tree, then in the source tree |
11939 | 11963 | # (if the path is not absolute). The absolute path cannot be DOS-style, |
11940 | 11964 | # because $ac_f cannot contain `:'. |
11943 | 11967 | [\\/$]*) false;; |
11944 | 11968 | *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; |
11945 | 11969 | 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;; | |
11947 | 11971 | esac |
11948 | 11972 | case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac |
11949 | 11973 | as_fn_append ac_file_inputs " '$ac_f'" |
11969 | 11993 | esac |
11970 | 11994 | |
11971 | 11995 | 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 ;; | |
11974 | 11998 | esac |
11975 | 11999 | ;; |
11976 | 12000 | esac |
12100 | 12124 | s&@INSTALL@&$ac_INSTALL&;t t |
12101 | 12125 | $ac_datarootdir_hack |
12102 | 12126 | " |
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 | |
12105 | 12129 | |
12106 | 12130 | 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"; } && | |
12109 | 12134 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
12110 | 12135 | which seems to be undefined. Please make sure it is defined" >&5 |
12111 | 12136 | $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
12112 | 12137 | which seems to be undefined. Please make sure it is defined" >&2;} |
12113 | 12138 | |
12114 | rm -f "$tmp/stdin" | |
12139 | rm -f "$ac_tmp/stdin" | |
12115 | 12140 | 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";; | |
12118 | 12143 | esac \ |
12119 | 12144 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 |
12120 | 12145 | ;; |
12125 | 12150 | if test x"$ac_file" != x-; then |
12126 | 12151 | { |
12127 | 12152 | $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" \ | |
12130 | 12155 | || 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 | |
12132 | 12157 | { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 |
12133 | 12158 | $as_echo "$as_me: $ac_file is unchanged" >&6;} |
12134 | 12159 | else |
12135 | 12160 | rm -f "$ac_file" |
12136 | mv "$tmp/config.h" "$ac_file" \ | |
12161 | mv "$ac_tmp/config.h" "$ac_file" \ | |
12137 | 12162 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 |
12138 | 12163 | fi |
12139 | 12164 | else |
12140 | 12165 | $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" \ | |
12142 | 12167 | || as_fn_error $? "could not create -" "$LINENO" 5 |
12143 | 12168 | fi |
12144 | 12169 | ;; |
1170 | 1170 | dnl libraries will be compiled as PIC if perl requires PIC objects |
1171 | 1171 | dnl -- this is needed on NetBSD and Linux, but seems to cause problems on atleast Solaris -- |
1172 | 1172 | case "${target_os}" in |
1173 | linux*|netbsd*) | |
1173 | linux*|netbsd*|freebsd*|dragonfly*) | |
1174 | 1174 | AC_MSG_CHECKING(for perl cccdlflags needed on "${target_os}") |
1175 | 1175 | eval `${PERL} -V:cccdlflags` |
1176 | 1176 | PERL_CCCDLFLAGS="$cccdlflags" |
6 | 6 | <title>Changes to the Cyrus IMAP Server</title> |
7 | 7 | </head> |
8 | 8 | <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> | |
9 | 74 | |
10 | 75 | <h1>Changes to the Cyrus IMAP Server since 2.4.8</h1> |
11 | 76 | <ul> |
6 | 6 | <body> |
7 | 7 | |
8 | 8 | <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> | |
9 | 34 | |
10 | 35 | <h2>Upgrading from 2.4.8</h2> |
11 | 36 | <ul> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:34 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:38 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:34 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:38 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:34 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:38 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:38 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:38 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:38 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:35 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:36 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:39 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:36 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
353 | 353 | <p style="margin-left:18%;">Maximum number of transactions |
354 | 354 | to be supported in the berkeley environment.</p> |
355 | 355 | |
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 | ||
356 | 364 | <p style="margin-left:11%;"><b>client_timeout:</b> 10</p> |
357 | 365 | |
358 | 366 | <p style="margin-left:18%;">Number of seconds to wait |
437 | 445 | ability to delete a mailbox. If a user has this right, they |
438 | 446 | will automatically be given the new ’x’ |
439 | 447 | 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 ’yes’, the LIST response | |
454 | will never include any other user’s mailbox. Admin | |
455 | users will always see all mailboxes. The default is | |
456 | ’no’</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 ’yes’, the LIST response | |
464 | will never include any non-user mailboxes. Admin users will | |
465 | always see all mailboxes. The default is | |
466 | ’no’</p> | |
440 | 467 | |
441 | 468 | |
442 | 469 | <p style="margin-left:11%;"><b>disconnect_on_vanished_mailbox:</b> |
940 | 967 | failure won’t occur until the mailbox is already over |
941 | 968 | quota.</p> |
942 | 969 | |
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 ’X’ instead. This is useful to avoid | |
978 | generating backscatter with certain MTAs like Postfix or | |
979 | Exim which accept such messages.</p> | |
980 | ||
943 | 981 | <p style="margin-left:11%;"><b>lmtpsocket:</b> |
944 | 982 | {configdirectory}/socket/lmtp</p> |
945 | 983 | |
946 | 984 | <p style="margin-left:18%;">Unix domain socket that lmtpd |
947 | 985 | listens on, used by deliver(8). This should match the path |
948 | 986 | 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> | |
949 | 996 | |
950 | 997 | <p style="margin-left:11%;"><b>loginrealms:</b> <empty |
951 | 998 | string></p> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:36 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:36 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:36 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:36 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
47 | 47 | <p style="margin-left:11%; margin-top: 1em"><b>ipurge</b> [ |
48 | 48 | <b>−f</b> ] [ <b>−C</b> <i>config-file</i> ] [ |
49 | 49 | <b>−x</b> ] [ <b>−X</b> ] [ <b>−i</b> ] [ |
50 | <b>−s</b> ] <br> | |
50 | <b>−s</b> ] [ <b>−o</b> ] <br> | |
51 | 51 | [ <b>−d</b> <i>days</i> | <b>−b</b> <i>bytes</i> |
52 | 52 | | <b>−k</b> <i>Kbytes</i> | <b>−m</b> |
53 | 53 | <i>Mbytes</i> ] <br> |
182 | 182 | |
183 | 183 | |
184 | 184 | <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>−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> | |
185 | 196 | </table> |
186 | 197 | |
187 | 198 | <h2>FILES |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:36 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:36 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:40 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:37 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:41 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:42 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:42 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:42 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:42 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:42 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:42 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:38 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:42 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
0 | 0 | <!-- Creator : groff version 1.21 --> |
1 | <!-- CreationDate: Tue Jun 21 21:51:39 2011 --> | |
1 | <!-- CreationDate: Thu Sep 8 21:03:42 2011 --> | |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
Binary diff not shown
Binary diff not shown
75 | 75 | <TD>Extended URLFETCH for Binary and Converted Parts</TD></TR> |
76 | 76 | <TR><TD><A HREF="http://www.ietf.org/internet-drafts/draft-daboo-imap-annotatemore-11.txt"> |
77 | 77 | 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> | |
79 | 88 | |
80 | 89 | |
81 | 90 | <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 | ||
0 | 57 | Changes to the Cyrus IMAP Server since 2.4.8 |
1 | 58 | |
2 | 59 | * fixed crashes in seen handling |
0 | 0 | Upgrading From Previous Versions |
1 | 1 | |
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 |
65 | 65 | |
66 | 66 | RFC 5524 Extended URLFETCH for Binary and Converted Parts |
67 | 67 | |
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 | |
69 | 79 | |
70 | 80 | POP |
71 | 81 |
455 | 455 | if (destfile) { |
456 | 456 | /* this will hopefully ensure that the link() actually happened |
457 | 457 | and makes sure that the file actually hits disk */ |
458 | r = fsync(fileno(destfile)); | |
458 | fsync(fileno(destfile)); | |
459 | 459 | fclose(destfile); |
460 | 460 | } |
461 | 461 | if (r) { |
120 | 120 | return r; |
121 | 121 | } |
122 | 122 | |
123 | time_t duplicate_check(char *id, int idlen, const char *to, int tolen) | |
123 | time_t duplicate_check(duplicate_key_t *dkey) | |
124 | 124 | { |
125 | 125 | char buf[1024]; |
126 | int idlen = strlen(dkey->id); | |
127 | int tolen = strlen(dkey->to); | |
128 | int datelen = strlen(dkey->date); | |
126 | 129 | int r; |
127 | 130 | const char *data = NULL; |
128 | 131 | int len = 0; |
130 | 133 | |
131 | 134 | if (!duplicate_dbopen) return 0; |
132 | 135 | |
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); | |
135 | 138 | buf[idlen] = '\0'; |
136 | memcpy(buf + idlen + 1, to, tolen); | |
139 | memcpy(buf + idlen + 1, dkey->to, tolen); | |
137 | 140 | 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'; | |
138 | 144 | |
139 | 145 | do { |
140 | 146 | 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' */ | |
143 | 148 | &data, &len, NULL); |
144 | 149 | } while (r == CYRUSDB_AGAIN); |
145 | 150 | |
151 | 156 | memcpy(&mark, data, sizeof(time_t)); |
152 | 157 | } else if (r != CYRUSDB_OK) { |
153 | 158 | 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)); | |
157 | 162 | } |
158 | 163 | mark = 0; |
159 | 164 | } |
160 | 165 | |
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); | |
163 | 168 | |
164 | 169 | return mark; |
165 | 170 | } |
166 | 171 | |
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); | |
171 | 177 | 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) | |
178 | 183 | { |
179 | 184 | char buf[1024], data[100]; |
185 | int idlen = strlen(dkey->id); | |
186 | int tolen = strlen(dkey->to); | |
187 | int datelen = strlen(dkey->date); | |
180 | 188 | int r; |
181 | 189 | |
182 | 190 | if (!duplicate_dbopen) return; |
183 | 191 | |
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); | |
186 | 194 | buf[idlen] = '\0'; |
187 | memcpy(buf + idlen + 1, to, tolen); | |
195 | memcpy(buf + idlen + 1, dkey->to, tolen); | |
188 | 196 | 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'; | |
189 | 200 | |
190 | 201 | memcpy(data, &mark, sizeof(mark)); |
191 | 202 | memcpy(data + sizeof(mark), &uid, sizeof(uid)); |
192 | 203 | |
193 | 204 | do { |
194 | 205 | 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' */ | |
197 | 207 | data, sizeof(mark)+sizeof(uid), NULL); |
198 | 208 | } while (r == CYRUSDB_AGAIN); |
199 | 209 | |
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); | |
202 | 212 | |
203 | 213 | return; |
204 | 214 | } |
48 | 48 | /* name of the duplicate delivery database */ |
49 | 49 | #define FNAME_DELIVERDB "/deliver.db" |
50 | 50 | |
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 | ||
51 | 59 | int duplicate_init(const char *fname, int myflags); |
52 | 60 | |
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); | |
57 | 64 | int duplicate_find(char *msgid, int (*proc)(), void *rock); |
58 | 65 | |
59 | 66 | int duplicate_prune(int seconds, struct hash_table *expire_table); |
298 | 298 | { "ESEARCH", 2 }, |
299 | 299 | { "SORT", 2 }, |
300 | 300 | { "SORT=MODSEQ", 2 }, |
301 | { "SORT=DISPLAY", 2 }, | |
301 | 302 | { "THREAD=ORDEREDSUBJECT", 2 }, |
302 | 303 | { "THREAD=REFERENCES", 2 }, |
303 | 304 | { "ANNOTATEMORE", 2 }, |
7100 | 7101 | sawone[NAMESPACE_INBOX] = |
7101 | 7102 | !mboxlist_lookup(inboxname, NULL, NULL); |
7102 | 7103 | } |
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]; | |
7105 | 7106 | } else { |
7106 | 7107 | pattern = xstrdup("%"); |
7107 | 7108 | /* now find all the exciting toplevel namespaces - |
9141 | 9142 | (*sortcrit)[n].key = SORT_CC; |
9142 | 9143 | else if (!strcmp(criteria.s, "date")) |
9143 | 9144 | (*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; | |
9144 | 9149 | else if (!strcmp(criteria.s, "from")) |
9145 | 9150 | (*sortcrit)[n].key = SORT_FROM; |
9146 | 9151 | else if (!strcmp(criteria.s, "size")) |
217 | 217 | SORT_ARRIVAL, |
218 | 218 | SORT_CC, |
219 | 219 | SORT_DATE, |
220 | SORT_DISPLAYFROM, | |
221 | SORT_DISPLAYTO, | |
220 | 222 | SORT_FROM, |
221 | 223 | SORT_SIZE, |
222 | 224 | SORT_SUBJECT, |
142 | 142 | static void index_checkflags(struct index_state *state, int dirty); |
143 | 143 | static char *find_msgid(char *str, char **rem); |
144 | 144 | static char *get_localpart_addr(const char *header); |
145 | static char *get_displayname(const char *header); | |
145 | 146 | static char *index_extract_subject(const char *subj, size_t len, int *is_refwd); |
146 | 147 | static char *_index_extract_subject(char *s, int *is_refwd); |
147 | 148 | static void index_get_ids(MsgData *msgdata, |
173 | 174 | struct vanished_params *params); |
174 | 175 | static struct seqset *_parse_sequence(struct index_state *state, |
175 | 176 | const char *sequence, int usinguid); |
177 | static void massage_header(char *hdr); | |
176 | 178 | |
177 | 179 | /* NOTE: Make sure these are listed in CAPABILITY_STRING */ |
178 | 180 | static const struct thread_algorithm thread_algs[] = { |
1349 | 1351 | if (CONFIG_TIMING_VERBOSE) { |
1350 | 1352 | int len; |
1351 | 1353 | char *key_names[] = { "SEQUENCE", "ARRIVAL", "CC", "DATE", "FROM", |
1352 | "SIZE", "SUBJECT", "TO", "ANNOTATION", "MODSEQ" }; | |
1354 | "SIZE", "SUBJECT", "TO", "ANNOTATION", "MODSEQ", | |
1355 | "DISPLAYFROM", "DISPLAYTO" }; | |
1353 | 1356 | char buf[1024] = ""; |
1354 | 1357 | |
1355 | 1358 | while (sortcrit->key && sortcrit->key < VECTOR_SIZE(key_names)) { |
3504 | 3507 | for (j = 0; sortcrit[j].key; j++) { |
3505 | 3508 | label = sortcrit[j].key; |
3506 | 3509 | |
3507 | if ((label == SORT_CC || | |
3510 | if ((label == SORT_CC || label == SORT_DATE || | |
3508 | 3511 | 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) && | |
3510 | 3514 | !did_cache) { |
3511 | 3515 | |
3512 | 3516 | /* fetch cached info */ |
3577 | 3581 | index_get_ids(cur, envtokens, cacheitem_base(&im->record, CACHE_HEADERS), |
3578 | 3582 | cacheitem_size(&im->record, CACHE_HEADERS)); |
3579 | 3583 | 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; | |
3580 | 3592 | } |
3581 | 3593 | } |
3582 | 3594 | |
3586 | 3598 | return md; |
3587 | 3599 | } |
3588 | 3600 | |
3589 | /* | |
3590 | * Get the 'local-part' of an address from a header | |
3591 | */ | |
3592 | 3601 | static char *get_localpart_addr(const char *header) |
3593 | 3602 | { |
3594 | 3603 | struct address *addr = NULL; |
3595 | 3604 | char *ret; |
3596 | 3605 | |
3597 | 3606 | 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 | ||
3599 | 3616 | 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 | ||
3600 | 3653 | return ret; |
3601 | 3654 | } |
3602 | 3655 | |
3643 | 3696 | base = xstrdup(base); |
3644 | 3697 | |
3645 | 3698 | free(buf); |
3699 | ||
3700 | for (s = base; *s; s++) { | |
3701 | *s = toupper(*s); | |
3702 | } | |
3646 | 3703 | |
3647 | 3704 | return base; |
3648 | 3705 | } |
3905 | 3962 | /* allocate some space for refs */ |
3906 | 3963 | msgdata->ref = (char **) xmalloc(refsize * sizeof(char *)); |
3907 | 3964 | /* find references */ |
3965 | massage_header(buf); | |
3908 | 3966 | refstr = buf; |
3909 | 3967 | while ((ref = find_msgid(refstr, &refstr)) != NULL) { |
3910 | 3968 | /* reallocate space for this msgid if necessary */ |
4001 | 4059 | case SORT_MODSEQ: |
4002 | 4060 | ret = numcmp(md1->modseq, md2->modseq); |
4003 | 4061 | 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; | |
4004 | 4068 | } |
4005 | 4069 | } while (!ret && sortcrit[i++].key != SORT_SEQUENCE); |
4006 | 4070 | |
4020 | 4084 | FREE(md->cc); |
4021 | 4085 | FREE(md->from); |
4022 | 4086 | FREE(md->to); |
4087 | FREE(md->displayfrom); | |
4088 | FREE(md->displayto); | |
4023 | 4089 | FREE(md->xsubj); |
4024 | 4090 | FREE(md->msgid); |
4025 | 4091 | for (i = 0; i < md->nref; i++) |
144 | 144 | char *cc; /* local-part of first "cc" address */ |
145 | 145 | char *from; /* local-part of first "from" address */ |
146 | 146 | 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 */ | |
147 | 149 | char *xsubj; /* extracted subject text */ |
148 | 150 | unsigned xsubj_hash; /* hash of extracted subject text */ |
149 | 151 | int is_refwd; /* is message a reply or forward? */ |
81 | 81 | int exact = -1; |
82 | 82 | int pattern = -1; |
83 | 83 | int skipflagged = 0; |
84 | int onlydeleted = 0; | |
84 | 85 | int use_sentdate = 1; |
85 | 86 | int invertmatch = 0; |
86 | 87 | |
117 | 118 | fatal("must run as the Cyrus user", EC_USAGE); |
118 | 119 | } |
119 | 120 | |
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) { | |
121 | 122 | switch (option) { |
122 | 123 | case 'C': /* alt config file */ |
123 | 124 | alt_config = optarg; |
160 | 161 | } break; |
161 | 162 | case 'i' : { |
162 | 163 | invertmatch = 1; |
164 | } break; | |
165 | case 'o' : { | |
166 | onlydeleted = 1; | |
163 | 167 | } break; |
164 | 168 | case 'h': |
165 | 169 | default: usage(argv[0]); |
218 | 222 | |
219 | 223 | int |
220 | 224 | 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); | |
222 | 226 | printf("\tthere are no defaults and at least one of -d, -b, -k, -m\n\tmust be specified\n"); |
223 | 227 | printf("\tif no mboxpattern is given %s works on all mailboxes\n", name); |
224 | 228 | printf("\t -x specifies an exact match for days or size\n"); |
226 | 230 | printf("\t -s skip over messages that are flagged.\n"); |
227 | 231 | printf("\t -X use delivery time instead of date header for date matches.\n"); |
228 | 232 | 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"); | |
229 | 234 | exit(0); |
230 | 235 | } |
231 | 236 | |
293 | 298 | if (skipflagged && record->system_flags & FLAG_FLAGGED) |
294 | 299 | return 0; |
295 | 300 | |
301 | if (onlydeleted && !(record->system_flags & FLAG_DELETED)) | |
302 | return 0; | |
303 | ||
296 | 304 | if (exact == 1) { |
297 | 305 | if (days >= 0) { |
298 | 306 | /* printf("comparing %ld :: %ld\n", my_time, the_record->sentdate); */ |
224 | 224 | time_t t; |
225 | 225 | char datestr[80]; |
226 | 226 | pid_t sm_pid, p; |
227 | duplicate_key_t dkey = DUPLICATE_INITIALIZER; | |
227 | 228 | |
228 | 229 | smbuf[0] = "sendmail"; |
229 | 230 | smbuf[1] = "-i"; /* ignore dots */ |
243 | 244 | global_outgoing_count++, config_servername); |
244 | 245 | |
245 | 246 | 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); | |
247 | 253 | fprintf(sm, "Message-ID: %s\r\n", buf); |
248 | ||
249 | rfc822date_gen(datestr, sizeof(datestr), t); | |
250 | 254 | fprintf(sm, "Date: %s\r\n", datestr); |
251 | 255 | |
252 | 256 | fprintf(sm, "X-Sieve: %s\r\n", SIEVE_VERSION); |
367 | 371 | script_data_t *sd = (script_data_t *) sc; |
368 | 372 | message_data_t *m = ((deliver_data_t *) mc)->m; |
369 | 373 | char buf[8192], *sievedb = NULL; |
374 | duplicate_key_t dkey = DUPLICATE_INITIALIZER; | |
370 | 375 | int res; |
371 | 376 | |
372 | 377 | /* if we have a msgid, we can track our redirects */ |
374 | 379 | snprintf(buf, sizeof(buf), "%s-%s", m->id, rc->addr); |
375 | 380 | sievedb = make_sieve_db(sd->username); |
376 | 381 | |
382 | dkey.id = buf; | |
383 | dkey.to = sievedb; | |
384 | dkey.date = ((deliver_data_t *) mc)->m->date; | |
377 | 385 | /* 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"); | |
380 | 388 | return SIEVE_OK; |
381 | 389 | } |
382 | 390 | } |
383 | 391 | |
384 | 392 | if ((res = send_forward(rc->addr, m->return_path, m->data)) == 0) { |
385 | 393 | /* 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); | |
388 | 395 | |
389 | 396 | snmp_increment(SIEVE_REDIRECT, 1); |
390 | 397 | syslog(LOG_INFO, "sieve redirected: %s to: %s", |
493 | 500 | fc->imapflags->flag, fc->imapflags->nflags, |
494 | 501 | (char *) sd->username, sd->authstate, md->id, |
495 | 502 | sd->username, mdata->notifyheader, |
496 | namebuf, quotaoverride, 0); | |
503 | namebuf, md->date, quotaoverride, 0); | |
497 | 504 | } |
498 | 505 | |
499 | 506 | if (!ret) { |
553 | 560 | return SIEVE_OK; |
554 | 561 | } |
555 | 562 | |
563 | static const char hex[] = "0123456789ABCDEF"; | |
564 | ||
556 | 565 | static int autorespond(void *ac, |
557 | 566 | void *ic __attribute__((unused)), |
558 | 567 | void *sc, |
563 | 572 | script_data_t *sd = (script_data_t *) sc; |
564 | 573 | time_t t, now; |
565 | 574 | int ret; |
575 | int i; | |
576 | duplicate_key_t dkey = DUPLICATE_INITIALIZER; | |
577 | char *id; | |
566 | 578 | |
567 | 579 | snmp_increment(SIEVE_VACATION_TOTAL, 1); |
568 | 580 | |
569 | 581 | now = time(NULL); |
570 | 582 | |
571 | 583 | /* 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); | |
574 | 594 | if (t) { |
575 | 595 | if (now >= t) { |
576 | 596 | /* yay, we can respond again! */ |
584 | 604 | } |
585 | 605 | |
586 | 606 | 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); | |
591 | 611 | |
592 | 612 | return ret; |
593 | 613 | } |
606 | 626 | sieve_send_response_context_t *src = (sieve_send_response_context_t *) ac; |
607 | 627 | message_data_t *md = ((deliver_data_t *) mc)->m; |
608 | 628 | script_data_t *sdata = (script_data_t *) sc; |
629 | duplicate_key_t dkey = DUPLICATE_INITIALIZER; | |
609 | 630 | |
610 | 631 | smbuf[0] = "sendmail"; |
611 | 632 | smbuf[1] = "-i"; /* ignore dots */ |
666 | 687 | if (sm_stat == 0) { /* sendmail exit value */ |
667 | 688 | sievedb = make_sieve_db(sdata->username); |
668 | 689 | |
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); | |
671 | 694 | |
672 | 695 | snmp_increment(SIEVE_VACATION_REPLIED, 1); |
673 | 696 | |
878 | 901 | char userbuf[MAX_MAILBOX_BUFFER] = ""; |
879 | 902 | char authuserbuf[MAX_MAILBOX_BUFFER]; |
880 | 903 | int r = 0; |
904 | duplicate_key_t dkey = DUPLICATE_INITIALIZER; | |
881 | 905 | |
882 | 906 | if (!user) { |
883 | 907 | /* shared mailbox, check for annotation */ |
934 | 958 | domain ? domain : ""); |
935 | 959 | sdb = make_sieve_db(namebuf); |
936 | 960 | |
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); | |
939 | 965 | } |
940 | 966 | |
941 | 967 | /* free everything */ |
495 | 495 | const char *user, |
496 | 496 | char *notifyheader, |
497 | 497 | const char *mailboxname, |
498 | char *date, | |
498 | 499 | int quotaoverride, |
499 | 500 | int acloverride) |
500 | 501 | { |
502 | 503 | struct appendstate as; |
503 | 504 | unsigned long uid; |
504 | 505 | const char *notifier; |
506 | duplicate_key_t dkey = {NULL, NULL, NULL}; | |
505 | 507 | |
506 | 508 | r = append_setup(&as, mailboxname, |
507 | 509 | authuser, authstate, acloverride ? 0 : ACL_POST, |
510 | 512 | (long) size : 0); |
511 | 513 | |
512 | 514 | /* check for duplicate message */ |
515 | dkey.id = id; | |
516 | dkey.to = mailboxname; | |
517 | dkey.date = date; | |
513 | 518 | 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"); | |
516 | 521 | append_abort(&as); |
517 | 522 | return 0; |
518 | 523 | } |
538 | 543 | syslog(LOG_INFO, "Delivered: %s to mailbox: %s", |
539 | 544 | id, mailboxname); |
540 | 545 | if (dupelim && id) { |
541 | duplicate_mark(id, strlen(id), mailboxname, | |
542 | strlen(mailboxname), time(NULL), uid); | |
546 | duplicate_mark(&dkey, time(NULL), uid); | |
543 | 547 | } |
544 | 548 | mailbox_close(&mailbox); |
545 | 549 | } |
604 | 608 | struct rcpt *rc; |
605 | 609 | struct backend *remote; |
606 | 610 | int i = 0; |
607 | int r = 0; | |
608 | 611 | |
609 | 612 | lt->from = msgdata->return_path; |
610 | 613 | lt->auth = d->authas[0] ? d->authas : NULL; |
626 | 629 | remote = proxy_findserver(d->server, &lmtp_protocol, "", |
627 | 630 | &backend_cached, NULL, NULL, NULL); |
628 | 631 | 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); | |
630 | 636 | } else { |
631 | 637 | /* remote server not available; tempfail all deliveries */ |
632 | 638 | for (rc = d->to, i = 0; i < d->rnum; i++) { |
687 | 693 | md->size, flag, nflags, |
688 | 694 | mydata->authuser, mydata->authstate, md->id, |
689 | 695 | NULL, mydata->notifyheader, |
690 | namebuf, quotaoverride, 0); | |
696 | namebuf, md->date, quotaoverride, 0); | |
691 | 697 | } |
692 | 698 | |
693 | 699 | /* case 2: ordinary user */ |
707 | 713 | md->size, flag, nflags, |
708 | 714 | mydata->authuser, mydata->authstate, md->id, |
709 | 715 | username, mydata->notifyheader, |
710 | namebuf, quotaoverride, 0); | |
716 | namebuf, md->date, quotaoverride, 0); | |
711 | 717 | } |
712 | 718 | if (ret2 == IMAP_MAILBOX_NONEXISTENT && mailboxname && |
713 | 719 | config_getswitch(IMAPOPT_LMTP_FUZZY_MAILBOX_MATCH) && |
717 | 723 | md->size, flag, nflags, |
718 | 724 | mydata->authuser, mydata->authstate, md->id, |
719 | 725 | username, mydata->notifyheader, |
720 | namebuf, quotaoverride, 0); | |
726 | namebuf, md->date, quotaoverride, 0); | |
721 | 727 | } |
722 | 728 | if (ret2) { |
723 | 729 | /* normal delivery to INBOX */ |
729 | 735 | md->size, flag, nflags, |
730 | 736 | (char *) username, authstate, md->id, |
731 | 737 | username, mydata->notifyheader, |
732 | namebuf, quotaoverride, 1); | |
738 | namebuf, md->date, quotaoverride, 1); | |
733 | 739 | |
734 | 740 | if (authstate) auth_freestate(authstate); |
735 | 741 | } |
88 | 88 | const char *user, |
89 | 89 | char *notifyheader, |
90 | 90 | const char *mailboxname, |
91 | char *date, | |
91 | 92 | int quotaoverride, |
92 | 93 | int acloverride); |
93 | 94 |
281 | 281 | ret->return_path = NULL; |
282 | 282 | ret->rcpt = NULL; |
283 | 283 | ret->rcpt_num = 0; |
284 | ret->date = NULL; | |
284 | 285 | |
285 | 286 | ret->authuser = NULL; |
286 | 287 | ret->authstate = NULL; |
318 | 319 | } |
319 | 320 | free(m->rcpt); |
320 | 321 | } |
322 | if (m->date) { | |
323 | free(m->date); | |
324 | } | |
321 | 325 | |
322 | 326 | if (m->authuser) { |
323 | 327 | free(m->authuser); |
461 | 465 | { |
462 | 466 | char *p, *ret; |
463 | 467 | int len; |
468 | int lmtp_strict_rfc2821 = config_getswitch(IMAPOPT_LMTP_STRICT_RFC2821); | |
464 | 469 | |
465 | 470 | p = s; |
466 | 471 | |
499 | 504 | if (!*++p) return 0; |
500 | 505 | } |
501 | 506 | 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 | } | |
502 | 513 | if (*p <= ' ' || (*p & 128) || |
503 | 514 | strchr("<>()[]\\,;:\"", *p)) return 0; |
504 | 515 | } |
733 | 744 | } |
734 | 745 | |
735 | 746 | /* get date */ |
736 | if (!spool_getheader(m->hdrcache, "date")) { | |
747 | if (!(body = spool_getheader(m->hdrcache, "date"))) { | |
737 | 748 | /* no date, create one */ |
738 | 749 | addbody = xstrdup(datestr); |
750 | m->date = xstrdup(datestr); | |
739 | 751 | fprintf(f, "Date: %s\r\n", addbody); |
740 | 752 | spool_cache_header(xstrdup("Date"), addbody, m->hdrcache); |
753 | } | |
754 | else { | |
755 | m->date = xstrdup(body[0]); | |
741 | 756 | } |
742 | 757 | |
743 | 758 | if (!m->return_path && |
64 | 64 | char *return_path; /* where to return message */ |
65 | 65 | address_data_t **rcpt; /* to recipients of this message */ |
66 | 66 | int rcpt_num; /* number of recipients */ |
67 | char *date; /* date field of header */ | |
67 | 68 | |
68 | 69 | /* auth state */ |
69 | 70 | char *authuser; |
2139 | 2139 | /* Append MUST have a message with data */ |
2140 | 2140 | assert(record->size); |
2141 | 2141 | |
2142 | /* GUID must not be null */ | |
2143 | assert(!message_guid_isnull(&record->guid)); | |
2144 | ||
2142 | 2145 | /* belt AND suspenders - check the previous record too */ |
2143 | 2146 | if (mailbox->i.num_records) { |
2144 | 2147 | struct index_record prev; |
174 | 174 | /* copy out interesting parts */ |
175 | 175 | mbtype = strtol(data, &p, 10); |
176 | 176 | |
177 | if (*p == ' ') p++; | |
177 | if (!p) | |
178 | return IMAP_IOERROR; | |
179 | ||
180 | if (*p == ' ' && (p - data) < datalen) p++; | |
178 | 181 | q = partition; |
179 | while (*p != ' ') { /* copy out partition name */ | |
182 | while (*p != ' ' && (p - data) < datalen) { /* copy out partition name */ | |
180 | 183 | *q++ = *p++; |
181 | 184 | } |
182 | 185 | *q = '\0'; |
1754 | 1757 | return r; |
1755 | 1758 | } |
1756 | 1759 | |
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 | ||
1757 | 1770 | /* |
1758 | 1771 | * Find all mailboxes that match 'pattern'. |
1759 | 1772 | * 'isadmin' is nonzero if user is a mailbox admin. 'userid' |
1764 | 1777 | * case it wants some persistant storage or extra data. |
1765 | 1778 | */ |
1766 | 1779 | /* Find all mailboxes that match 'pattern'. */ |
1767 | int mboxlist_findall(struct namespace *namespace __attribute__((unused)), | |
1780 | int mboxlist_findall(struct namespace *namespace, | |
1768 | 1781 | const char *pattern, int isadmin, const char *userid, |
1769 | 1782 | struct auth_state *auth_state, int (*proc)(), void *rock) |
1770 | 1783 | { |
1780 | 1793 | char domainpat[MAX_MAILBOX_BUFFER] = ""; /* do intra-domain fetches only */ |
1781 | 1794 | char *pat = NULL; |
1782 | 1795 | |
1796 | if (!namespace) namespace = mboxname_get_adminnamespace(); | |
1797 | ||
1783 | 1798 | if (config_virtdomains) { |
1784 | 1799 | char *domain; |
1785 | 1800 | |
1912 | 1927 | NULL); |
1913 | 1928 | } |
1914 | 1929 | |
1915 | if(!r) { | |
1930 | if (!r && (isadmin || namespace->accessible[NAMESPACE_USER])) { | |
1916 | 1931 | cbrock.find_namespace = NAMESPACE_USER; |
1917 | 1932 | /* switch to pattern with domain prepended */ |
1918 | 1933 | glob_free(&cbrock.g); |
1957 | 1972 | char domainpat[MAX_MAILBOX_BUFFER]; /* do intra-domain fetches only */ |
1958 | 1973 | char *pat = NULL; |
1959 | 1974 | |
1975 | if (!namespace) namespace = mboxname_get_adminnamespace(); | |
1976 | ||
1960 | 1977 | if (config_virtdomains && userid && (p = strchr(userid, '@'))) { |
1961 | 1978 | userlen = p - userid; |
1962 | 1979 | domainlen = strlen(p); /* includes separator */ |
2056 | 2073 | * |
2057 | 2074 | * If "Other Users*" can match pattern, search for those mailboxes next |
2058 | 2075 | */ |
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, | |
2063 | 2081 | prefixlen < len ? prefixlen : len)) { |
2064 | 2082 | |
2065 | if (prefixlen < len) { | |
2066 | strlcpy(domainpat+domainlen, pattern+prefixlen, | |
2083 | if (prefixlen < len) { | |
2084 | strlcpy(domainpat+domainlen, pattern+prefixlen, | |
2067 | 2085 | 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 */ | |
2071 | 2097 | 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 | } | |
2086 | 2105 | } |
2087 | 2106 | |
2088 | 2107 | /* |
2091 | 2110 | * search for all remaining mailboxes. |
2092 | 2111 | * just bother looking at the ones that have the same pattern prefix. |
2093 | 2112 | */ |
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, '.') && | |
2111 | 2131 | pattern[strlen(pattern)-1] == '%') { |
2112 | 2132 | /* 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); | |
2120 | 2157 | 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, | |
2132 | 2162 | 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 | } | |
2143 | 2164 | } |
2144 | 2165 | } |
2145 | 2166 | |
2534 | 2555 | * is the user's login id. For each matching mailbox, calls |
2535 | 2556 | * 'proc' with the name of the mailbox. |
2536 | 2557 | */ |
2537 | int mboxlist_findsub(struct namespace *namespace __attribute__((unused)), | |
2558 | int mboxlist_findsub(struct namespace *namespace, | |
2538 | 2559 | const char *pattern, int isadmin __attribute__((unused)), |
2539 | 2560 | const char *userid, struct auth_state *auth_state, |
2540 | 2561 | int (*proc)(), void *rock, int force) |
2552 | 2573 | char domainpat[MAX_MAILBOX_BUFFER]; /* do intra-domain fetches only */ |
2553 | 2574 | char *pat = NULL; |
2554 | 2575 | |
2576 | if (!namespace) namespace = mboxname_get_adminnamespace(); | |
2577 | ||
2555 | 2578 | if (config_virtdomains && userid && (p = strchr(userid, '@'))) { |
2556 | 2579 | userlen = p - userid; |
2557 | 2580 | domainlen = strlen(p); /* includes separator */ |
2662 | 2685 | cbrock.usermboxnamelen = 0; |
2663 | 2686 | } |
2664 | 2687 | |
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 | } | |
2679 | 2704 | |
2680 | 2705 | done: |
2681 | 2706 | if (subs) mboxlist_closesubs(subs); |
2719 | 2744 | char domainpat[MAX_MAILBOX_BUFFER]; /* do intra-domain fetches only */ |
2720 | 2745 | char *pat = NULL; |
2721 | 2746 | |
2747 | if (!namespace) namespace = mboxname_get_adminnamespace(); | |
2748 | ||
2722 | 2749 | if (config_virtdomains && userid && (p = strchr(userid, '@'))) { |
2723 | 2750 | userlen = p - userid; |
2724 | 2751 | domainlen = strlen(p); /* includes separator */ |
2826 | 2853 | * |
2827 | 2854 | * If "Other Users*" can match pattern, search for those subscriptions next |
2828 | 2855 | */ |
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 | } | |
2856 | 2886 | } |
2857 | 2887 | |
2858 | 2888 | /* |
2861 | 2891 | * search for all remaining subscriptions. |
2862 | 2892 | * just bother looking at the ones that have the same pattern prefix. |
2863 | 2893 | */ |
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); | |
2890 | 2938 | 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 | } | |
2913 | 2945 | } |
2914 | 2946 | } |
2915 | 2947 |
161 | 161 | |
162 | 162 | /* direct access to subs DB */ |
163 | 163 | int mboxlist_allsubs(const char *userid, foreach_cb *proc, void *rock); |
164 | int mboxlist_allmbox(const char *prefix, foreach_cb *proc, void *rock); | |
164 | 165 | |
165 | 166 | /* Find subscribed mailboxes that match 'pattern'. */ |
166 | 167 | int mboxlist_findsub(struct namespace *namespace, |
72 | 72 | |
73 | 73 | static struct mboxlocklist *open_mboxlocks = NULL; |
74 | 74 | |
75 | static struct namespace *admin_namespace; | |
76 | ||
75 | 77 | /* Mailbox patterns which the design of the server prohibits */ |
76 | 78 | static char *badmboxpatterns[] = { |
77 | 79 | "", |
643 | 645 | config_getswitch(IMAPOPT_UNIXHIERARCHYSEP) ? '/' : '.'; |
644 | 646 | namespace->isalt = !isadmin && config_getswitch(IMAPOPT_ALTNAMESPACE); |
645 | 647 | |
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 | ||
646 | 652 | if (namespace->isalt) { |
647 | 653 | /* alternate namespace */ |
648 | 654 | strcpy(namespace->prefix[NAMESPACE_INBOX], ""); |
687 | 693 | return 0; |
688 | 694 | } |
689 | 695 | |
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 | ||
690 | 706 | /* |
691 | 707 | * Translate separator charactors in a mailboxname from its external |
692 | 708 | * representation to its internal representation '.'. |
744 | 760 | */ |
745 | 761 | int mboxname_userownsmailbox(const char *userid, const char *name) |
746 | 762 | { |
747 | struct namespace internal = { '.', 0, 0, { "INBOX.", "user.", "" }, | |
748 | NULL, NULL, NULL, NULL }; | |
763 | struct namespace internal = NAMESPACE_INITIALIZER; | |
749 | 764 | char inboxname[MAX_MAILBOX_BUFFER]; |
750 | 765 | |
751 | 766 | if (!mboxname_tointernal(&internal, "INBOX", userid, inboxname) && |
993 | 1008 | } |
994 | 1009 | return 0; |
995 | 1010 | } |
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 | ||
996 | 1033 | |
997 | 1034 | void mboxname_hash(char *buf, size_t buf_len, |
998 | 1035 | const char *root, |
62 | 62 | int isalt; /* are we using the alternate namespace? */ |
63 | 63 | int isadmin; /* current user is an admin */ |
64 | 64 | char prefix[3][MAX_NAMESPACE_PREFIX+1]; |
65 | int accessible[3]; | |
65 | 66 | /* Convert the external mailbox 'name' to an internal name. */ |
66 | 67 | int (*mboxname_tointernal)(struct namespace *namespace, const char *name, |
67 | 68 | const char *userid, char *result); |
78 | 79 | void *rock, int force); |
79 | 80 | }; |
80 | 81 | |
82 | #define NAMESPACE_INITIALIZER { '.', 0, 0, \ | |
83 | { "INBOX.", "user.", "" }, \ | |
84 | { 0, 0, 0, }, \ | |
85 | NULL, NULL, NULL, NULL } | |
86 | ||
81 | 87 | struct mboxlock { |
82 | 88 | char *name; |
83 | 89 | int lock_fd; |
90 | 96 | |
91 | 97 | /* Create namespace based on config options. */ |
92 | 98 | int mboxname_init_namespace(struct namespace *namespace, int isadmin); |
99 | ||
100 | struct namespace *mboxname_get_adminnamespace(); | |
93 | 101 | |
94 | 102 | /* |
95 | 103 | * Translate separator charactors in a mailboxname from its external |
123 | 131 | * returns boolean |
124 | 132 | */ |
125 | 133 | 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); | |
126 | 137 | |
127 | 138 | /* |
128 | 139 | * Translate (internal) inboxname into corresponding userid. |
1816 | 1816 | struct param *boundary; |
1817 | 1817 | char *defaultContentType = DEFAULT_CONTENT_TYPE; |
1818 | 1818 | int i, depth; |
1819 | int limit = config_getint(IMAPOPT_BOUNDARY_LIMIT); | |
1819 | 1820 | |
1820 | 1821 | memset(&preamble, 0, sizeof(struct body)); |
1821 | 1822 | memset(&epilogue, 0, sizeof(struct body)); |
1850 | 1851 | message_parse_content(msg, &preamble, boundaries); |
1851 | 1852 | |
1852 | 1853 | /* Parse the component body-parts */ |
1853 | while (boundaries->count == depth) { | |
1854 | while (boundaries->count == depth && | |
1855 | (limit == 0 ? 1 : boundaries->count < limit)) { | |
1854 | 1856 | body->subpart = (struct body *)xrealloc((char *)body->subpart, |
1855 | 1857 | (body->numparts+1)*sizeof(struct body)); |
1856 | 1858 | message_parse_body(msg, &body->subpart[body->numparts++], |
1911 | 1913 | */ |
1912 | 1914 | body->boundary_size += epilogue.boundary_size; |
1913 | 1915 | 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 | } | |
1914 | 1921 | } |
1915 | 1922 | |
1916 | 1923 | /* |
2873 | 2873 | |
2874 | 2874 | char **rcpt; /* mailboxes to post message */ |
2875 | 2875 | int rcpt_num; /* number of groups */ |
2876 | char *date; /* date field of header */ | |
2876 | 2877 | |
2877 | 2878 | hdrcache_t hdrcache; |
2878 | 2879 | }; |
2890 | 2891 | ret->size = 0; |
2891 | 2892 | ret->rcpt = NULL; |
2892 | 2893 | ret->rcpt_num = 0; |
2894 | ret->date = NULL; | |
2893 | 2895 | |
2894 | 2896 | ret->hdrcache = spool_new_hdrcache(); |
2895 | 2897 | |
2922 | 2924 | free(m->rcpt[i]); |
2923 | 2925 | } |
2924 | 2926 | free(m->rcpt); |
2927 | } | |
2928 | if (m->date) { | |
2929 | free(m->date); | |
2925 | 2930 | } |
2926 | 2931 | |
2927 | 2932 | spool_free_hdrcache(m->hdrcache); |
3046 | 3051 | char datestr[80]; |
3047 | 3052 | |
3048 | 3053 | rfc822date_gen(datestr, sizeof(datestr), now); |
3054 | m->date = xstrdup(datestr); | |
3049 | 3055 | fprintf(f, "Date: %s\r\n", datestr); |
3050 | 3056 | spool_cache_header(xstrdup("Date"), xstrdup(datestr), m->hdrcache); |
3057 | } | |
3058 | else { | |
3059 | m->date = xstrdup(body[0]); | |
3051 | 3060 | } |
3052 | 3061 | |
3053 | 3062 | /* get control */ |
3278 | 3287 | unsigned long uid; |
3279 | 3288 | struct body *body = NULL; |
3280 | 3289 | struct dest *dlist = NULL; |
3290 | duplicate_key_t dkey = {msg->id, NULL, msg->date}; | |
3281 | 3291 | |
3282 | 3292 | /* check ACLs of all mailboxes */ |
3283 | 3293 | for (n = 0; n < msg->rcpt_num; n++) { |
3285 | 3295 | |
3286 | 3296 | /* look it up */ |
3287 | 3297 | r = mlookup(rcpt, &server, &acl, NULL); |
3298 | dkey.to = rcpt; | |
3288 | 3299 | if (r) return IMAP_MAILBOX_NONEXISTENT; |
3289 | 3300 | |
3290 | 3301 | if (!(acl && (myrights = cyrus_acl_myrights(nntp_authstate, acl)) && |
3300 | 3311 | struct appendstate as; |
3301 | 3312 | |
3302 | 3313 | if (msg->id && |
3303 | duplicate_check(msg->id, strlen(msg->id), rcpt, strlen(rcpt))) { | |
3314 | duplicate_check(&dkey)) { | |
3304 | 3315 | /* duplicate message */ |
3305 | duplicate_log(msg->id, rcpt, "nntp delivery"); | |
3316 | duplicate_log(&dkey, "nntp delivery"); | |
3306 | 3317 | continue; |
3307 | 3318 | } |
3308 | 3319 | |
3318 | 3329 | r = append_fromstream(&as, &body, msg->data, msg->size, 0, |
3319 | 3330 | (const char **) NULL, 0); |
3320 | 3331 | } |
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) ) ) { | |
3324 | 3333 | append_abort(&as); |
3325 | 3334 | |
3326 | 3335 | if (!r) { |
3327 | 3336 | /* duplicate message */ |
3328 | duplicate_log(msg->id, rcpt, "nntp delivery"); | |
3337 | duplicate_log(&dkey, "nntp delivery"); | |
3329 | 3338 | continue; |
3330 | 3339 | } |
3331 | 3340 | } |
3335 | 3344 | } |
3336 | 3345 | |
3337 | 3346 | 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); | |
3340 | 3348 | |
3341 | 3349 | if (r) return r; |
3342 | 3350 | |
3508 | 3516 | /* store msgid of cancelled message for IHAVE/CHECK/TAKETHIS |
3509 | 3517 | * (in case we haven't received the message yet) |
3510 | 3518 | */ |
3511 | duplicate_mark(msgid, strlen(msgid), "", 0, 0, time(NULL)); | |
3519 | duplicate_key_t dkey = {msgid, "", ""}; | |
3520 | duplicate_mark(&dkey, 0, time(NULL)); | |
3512 | 3521 | |
3513 | 3522 | return r; |
3514 | 3523 | } |
4154 | 4163 | else if (*c == '@') wild[n].not = -1; /* absolute not (feeding) */ |
4155 | 4164 | else wild[n].not = 0; |
4156 | 4165 | |
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 | ||
4158 | 4169 | wild[n++].pat = xstrdup(pattern); |
4159 | 4170 | } while (c != str); |
4160 | 4171 | wild[n].pat = NULL; |
74 | 74 | #endif |
75 | 75 | |
76 | 76 | #include "assert.h" |
77 | #include "bsearch.h" | |
77 | 78 | #include "cyrusdb.h" |
78 | 79 | #include "global.h" |
79 | 80 | #include "exitcodes.h" |
97 | 98 | /* config.c stuff */ |
98 | 99 | const int config_need_data = CONFIG_NEED_PARTITION_DATA; |
99 | 100 | |
100 | struct fix_rock { | |
101 | char *domain; | |
102 | struct txn **tid; | |
103 | unsigned long change_count; | |
104 | }; | |
105 | ||
106 | 101 | struct quotaentry { |
107 | 102 | struct quota quota; |
108 | 103 | char *allocname; |
114 | 109 | /* forward declarations */ |
115 | 110 | void usage(void); |
116 | 111 | 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); | |
123 | 119 | |
124 | 120 | #define QUOTAGROW 300 |
125 | 121 | |
128 | 124 | |
129 | 125 | int firstquota = 0; |
130 | 126 | int redofix = 0; |
131 | int partial; | |
132 | 127 | |
133 | 128 | int main(int argc,char **argv) |
134 | 129 | { |
135 | 130 | int opt; |
131 | int i; | |
136 | 132 | int fflag = 0; |
137 | 133 | int r, code = 0; |
138 | 134 | char *alt_config = NULL, *domain = NULL; |
139 | struct fix_rock frock; | |
140 | struct txn *tid = NULL; | |
141 | 135 | |
142 | 136 | if ((geteuid()) == 0 && (become_cyrus() != 0)) { |
143 | 137 | fatal("must run as the Cyrus user", EC_USAGE); |
169 | 163 | syslog(LOG_ERR, "%s", error_message(r)); |
170 | 164 | fatal(error_message(r), EC_CONFIG); |
171 | 165 | } |
166 | ||
167 | if (config_getswitch(IMAPOPT_IMPROVED_MBOXLIST_SORT)) | |
168 | compar = bsearch_compare; | |
169 | else | |
170 | compar = strcmp; | |
172 | 171 | |
173 | 172 | /* |
174 | 173 | * Lock mailbox list to prevent mailbox creation/deletion |
180 | 179 | quotadb_init(0); |
181 | 180 | quotadb_open(NULL); |
182 | 181 | |
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); | |
196 | 186 | |
197 | 187 | quotadb_close(); |
198 | 188 | quotadb_done(); |
202 | 192 | |
203 | 193 | if (r) code = convert_code(r); |
204 | 194 | else reportquota(); |
195 | ||
196 | /* just for neatness */ | |
197 | for (i = 0; i < quota_num; i++) | |
198 | free(quota[i].allocname); | |
199 | free(quota); | |
205 | 200 | |
206 | 201 | cyrus_done(); |
207 | 202 | |
213 | 208 | fprintf(stderr, |
214 | 209 | "usage: quota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n"); |
215 | 210 | exit(EC_USAGE); |
216 | } | |
211 | } | |
217 | 212 | |
218 | 213 | void errmsg(const char *fmt, const char *arg, int err) |
219 | 214 | { |
231 | 226 | } |
232 | 227 | |
233 | 228 | /* |
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 | { | |
240 | 234 | if (quota_num == quota_alloc) { |
241 | 235 | /* Create new qr list entry */ |
242 | 236 | quota_alloc += QUOTAGROW; |
245 | 239 | memset("a[quota_num], 0, QUOTAGROW * sizeof(struct quotaentry)); |
246 | 240 | } |
247 | 241 | |
248 | /* See if the mailbox name corresponds to a quotaroot */ | |
249 | quota[quota_num].quota.root = name; | |
250 | do { | |
251 | r = quota_read("a[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; | |
280 | 250 | } |
281 | 251 | |
282 | 252 | /* |
283 | 253 | * Build the list of quota roots in 'quota' |
284 | 254 | */ |
285 | int buildquotalist(char *domain, char **roots, int nroots, | |
286 | struct fix_rock *frock) | |
255 | int buildquotalist(char *domain, char **roots, int nroots) | |
287 | 256 | { |
288 | 257 | int i, r; |
289 | 258 | char buf[MAX_MAILBOX_BUFFER], *tail; |
296 | 265 | tail += domainlen; |
297 | 266 | } |
298 | 267 | |
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 | ||
299 | 276 | /* |
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. | |
303 | 279 | */ |
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("a_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("a_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; | |
317 | 315 | } |
318 | 316 | else { |
319 | strlcpy(tail, "*", sizeof(buf) - domainlen); | |
320 | } | |
321 | i++; | |
322 | ||
323 | r = (*quota_namespace.mboxlist_findall)("a_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 | } | |
331 | 325 | |
332 | 326 | return 0; |
333 | 327 | } |
335 | 329 | /* |
336 | 330 | * Account for mailbox 'name' when fixing the quota roots |
337 | 331 | */ |
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; | |
344 | 338 | 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 | } | |
383 | 361 | 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); | |
406 | 377 | |
407 | 378 | return r; |
408 | 379 | } |
411 | 382 | const char *root) |
412 | 383 | { |
413 | 384 | int r; |
414 | ||
415 | redofix = 1; | |
416 | 385 | |
417 | 386 | printf("%s: quota root %s --> %s\n", mailbox->name, |
418 | 387 | mailbox->quotaroot ? mailbox->quotaroot : "(none)", |
427 | 396 | /* |
428 | 397 | * Finish fixing up a quota root |
429 | 398 | */ |
430 | int fixquota_finish(int thisquota, struct txn **tid, unsigned long *count) | |
399 | int fixquota_finish(int thisquota) | |
431 | 400 | { |
432 | 401 | int r = 0; |
402 | struct txn *tid = NULL; | |
433 | 403 | |
434 | 404 | 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) | |
445 | 416 | 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("a[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("a[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? */ | |
458 | 427 | if (quota[thisquota].quota.used != quota[thisquota].newused) { |
459 | 428 | printf("%s: usage was " UQUOTA_T_FMT ", now " UQUOTA_T_FMT "\n", |
460 | 429 | quota[thisquota].quota.root, |
461 | 430 | quota[thisquota].quota.used, quota[thisquota].newused); |
462 | 431 | quota[thisquota].quota.used = quota[thisquota].newused; |
463 | r = quota_write("a[thisquota].quota, tid); | |
432 | r = quota_write("a[thisquota].quota, &tid); | |
464 | 433 | if (r) { |
465 | 434 | errmsg("failed writing quotaroot '%s'", |
466 | 435 | quota[thisquota].quota.root, r); |
436 | quota_abort(&tid); | |
467 | 437 | return r; |
468 | 438 | } |
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 | } | |
481 | 445 | |
482 | 446 | /* |
483 | 447 | * Fix all the quota roots |
484 | 448 | */ |
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)("a_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("a_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; | |
506 | 483 | } |
507 | 484 | } |
508 | 485 | |
509 | 486 | 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 | ||
518 | 494 | /* |
519 | 495 | * Print out the quota report |
520 | 496 | */ |
79 | 79 | int limit; /* in QUOTA_UNITS */ |
80 | 80 | }; |
81 | 81 | |
82 | typedef int quotaproc_t(struct quota *quota, void *rock); | |
83 | ||
82 | 84 | extern void quota_setroot(struct quota *quota, const char *root); |
83 | 85 | |
84 | 86 | extern int quota_read(struct quota *quota, struct txn **tid, int wrlock); |
92 | 94 | extern int quota_deleteroot(const char *quotaroot); |
93 | 95 | |
94 | 96 | 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); | |
95 | 99 | |
96 | 100 | extern void quota_free(struct quota *quota); |
97 | 101 |
70 | 70 | |
71 | 71 | static int quota_dbopen = 0; |
72 | 72 | |
73 | static int quota_parseval(const char *data, struct quota *quota) | |
74 | { | |
75 | if (sscanf(data, UQUOTA_T_FMT " %d", | |
76 | "a->used, "a->limit) != 2) | |
77 | return 0; | |
78 | return 1; | |
79 | } | |
80 | ||
73 | 81 | /* |
74 | 82 | * Read the quota entry 'quota' |
75 | 83 | */ |
93 | 101 | |
94 | 102 | switch (r) { |
95 | 103 | case CYRUSDB_OK: |
96 | if (!*data) | |
97 | return IMAP_QUOTAROOT_NONEXISTENT; | |
98 | else if (sscanf(data, UQUOTA_T_FMT " %d", | |
99 | "a->used, "a->limit) != 2) { | |
104 | if (!*data) return IMAP_QUOTAROOT_NONEXISTENT; | |
105 | if (!quota_parseval(data, quota)) { | |
100 | 106 | 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); | |
103 | 109 | return CYRUSDB_IOERROR; |
104 | 110 | } |
105 | 111 | break; |
120 | 126 | } |
121 | 127 | |
122 | 128 | 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, "a)) { | |
149 | r = fd->proc("a, 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; | |
123 | 170 | } |
124 | 171 | |
125 | 172 | /* |
226 | 273 | return (QDB->fetch(qdb, ret, strlen(ret), NULL, NULL, NULL) == 0); |
227 | 274 | } |
228 | 275 | |
229 | ||
230 | 276 | /* must be called after cyrus_init */ |
231 | 277 | void quotadb_init(int myflags) |
232 | 278 | { |
241 | 287 | { |
242 | 288 | int ret; |
243 | 289 | char *tofree = NULL; |
290 | int flags = CYRUSDB_CREATE; | |
244 | 291 | |
245 | 292 | if (!fname) |
246 | 293 | fname = config_getstring(IMAPOPT_QUOTA_DB_PATH); |
251 | 298 | fname = tofree; |
252 | 299 | } |
253 | 300 | |
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); | |
255 | 305 | if (ret != 0) { |
256 | 306 | syslog(LOG_ERR, "DBERROR: opening %s: %s", fname, |
257 | 307 | cyrusdb_strerror(ret)); |
545 | 545 | return SQUAT_OK; |
546 | 546 | |
547 | 547 | cleanup_fd: |
548 | close(b->fd); | |
548 | close(fd); | |
549 | 549 | return SQUAT_ERR; |
550 | 550 | } |
551 | 551 |
699 | 699 | static int copy_local(struct mailbox *mailbox, unsigned long uid) |
700 | 700 | { |
701 | 701 | uint32_t recno; |
702 | struct index_record record; | |
703 | char *oldfname, *newfname; | |
702 | struct index_record oldrecord; | |
704 | 703 | int r; |
705 | 704 | |
706 | 705 | 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); | |
708 | 707 | 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; | |
718 | 717 | |
719 | 718 | /* 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)); | |
722 | 721 | r = mailbox_copyfile(oldfname, newfname, 0); |
723 | 722 | free(oldfname); |
724 | 723 | free(newfname); |
725 | 724 | if (r) return r; |
726 | 725 | |
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); | |
729 | 733 | |
730 | 734 | /* done - return */ |
731 | 735 | return r; |
2598 | 2602 | syslog(LOG_ERR, "unable to setsocketopt(TCP_NODELAY): %m"); |
2599 | 2603 | } |
2600 | 2604 | |
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)) { | |
2603 | 2607 | 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 | } | |
2611 | 2616 | #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 | } | |
2618 | 2624 | #endif |
2619 | 2625 | #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 | } | |
2626 | 2633 | #endif |
2627 | 2634 | #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 | } | |
2634 | 2642 | #endif |
2635 | 2643 | } |
2636 | 2644 | } else { |
2657 | 2665 | /* links to sockets */ |
2658 | 2666 | sync_in = sync_backend->in; |
2659 | 2667 | 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 | ||
2660 | 2673 | } |
2661 | 2674 | |
2662 | 2675 | static void replica_disconnect() |
143 | 143 | |
144 | 144 | /* Nuke subscriptions */ |
145 | 145 | 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); | |
149 | 147 | if (r) goto fail; |
150 | 148 | |
151 | 149 | /* ignore failures here - the subs file gets deleted soon anyway */ |
348 | 348 | sync_in = prot_new(0, 0); |
349 | 349 | sync_out = prot_new(1, 1); |
350 | 350 | |
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 | ||
351 | 355 | /* Find out name of client host */ |
352 | 356 | salen = sizeof(sync_remoteaddr); |
353 | 357 | if (getpeername(0, (struct sockaddr *)&sync_remoteaddr, &salen) == 0 && |
1572 | 1572 | } |
1573 | 1573 | |
1574 | 1574 | just_write: |
1575 | record->silent = 1; | |
1576 | 1575 | return mailbox_append_index_record(mailbox, record); |
1577 | 1576 | } |
1578 | 1577 |
74 | 74 | #endif |
75 | 75 | |
76 | 76 | #include "assert.h" |
77 | #include "bsearch.h" | |
77 | 78 | #include "cyrusdb.h" |
78 | 79 | #include "exitcodes.h" |
79 | 80 | #include "hash.h" |
114 | 115 | char *data; /* allocated buffer for fetched data */ |
115 | 116 | |
116 | 117 | struct txn txn; /* transaction associated with this db handle */ |
118 | ||
119 | /* sorting function */ | |
120 | int (*compar) (const void *s1, const void *s2); | |
117 | 121 | }; |
118 | 122 | |
119 | 123 | 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 | } | |
121 | 144 | |
122 | 145 | /* simple hash so it's easy to find these things in the filesystem; |
123 | 146 | our human time is worth more than efficiency */ |
125 | 148 | { |
126 | 149 | int config_virtdomains = libcyrus_config_getswitch(CYRUSOPT_VIRTDOMAINS); |
127 | 150 | int config_fulldirhash = libcyrus_config_getswitch(CYRUSOPT_FULLDIRHASH); |
128 | const char *idx; | |
129 | 151 | char c, *p; |
130 | 152 | unsigned len; |
131 | 153 | |
157 | 179 | } |
158 | 180 | } |
159 | 181 | |
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); | |
167 | 183 | |
168 | 184 | if (snprintf(buf, size, "%s%c/%s", FNAME_QUOTADIR, c, qr) >= (int) size) { |
169 | 185 | fatal("insufficient buffer size in hash_quota", EC_TEMPFAIL); |
332 | 348 | return CYRUSDB_IOERROR; |
333 | 349 | } |
334 | 350 | |
351 | db->compar = (flags & CYRUSDB_MBOXSORT) ? compar_qr_mbox : compar_qr; | |
352 | ||
335 | 353 | *ret = db; |
336 | 354 | return 0; |
337 | 355 | } |
496 | 514 | return strcmp(qr1, qr2); |
497 | 515 | } |
498 | 516 | |
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 | ||
499 | 528 | #define PATH_ALLOC 100 |
500 | 529 | struct qr_path { |
501 | 530 | char **path; |
508 | 537 | int config_fulldirhash = libcyrus_config_getswitch(CYRUSOPT_FULLDIRHASH); |
509 | 538 | int config_virtdomains = libcyrus_config_getswitch(CYRUSOPT_VIRTDOMAINS); |
510 | 539 | char *endp; |
540 | char onlyc = '\0'; | |
511 | 541 | int c, i; |
512 | 542 | DIR *qrdir; |
513 | 543 | struct dirent *next = NULL; |
516 | 546 | endp = strstr(quota_path, FNAME_QUOTADIR) + strlen(FNAME_QUOTADIR); |
517 | 547 | strcpy(endp, "?/"); |
518 | 548 | |
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 | ||
519 | 553 | c = config_fulldirhash ? 'A' : 'a'; |
520 | 554 | for (i = 0; i < 26; i++, c++) { |
555 | if (onlyc && c != onlyc) continue; | |
521 | 556 | *endp = c; |
522 | 557 | |
523 | 558 | qrdir = opendir(quota_path); |
600 | 635 | DIR *qrdir; |
601 | 636 | struct dirent *next = NULL; |
602 | 637 | |
603 | n = snprintf(quota_path, sizeof(quota_path), "%s%s", | |
638 | n = snprintf(quota_path, sizeof(quota_path)-3, "%s%s", | |
604 | 639 | db->path, FNAME_DOMAINDIR); |
605 | 640 | |
606 | 641 | endp = quota_path + n; |
607 | strcpy(endp, "?/"); | |
608 | 642 | |
609 | 643 | c = config_fulldirhash ? 'A' : 'a'; |
610 | 644 | for (i = 0; i < 26; i++, c++) { |
611 | *endp = c; | |
645 | endp[0] = c; | |
646 | endp[1] = '/'; | |
647 | endp[2] = '\0'; | |
612 | 648 | |
613 | 649 | qrdir = opendir(quota_path); |
614 | 650 | |
632 | 668 | if (tid && !*tid) *tid = &db->txn; |
633 | 669 | |
634 | 670 | /* 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); | |
636 | 672 | |
637 | 673 | for (i = 0; i < pathbuf.count; i++) { |
638 | 674 | const char *data, *key; |
643 | 679 | |
644 | 680 | key = path_to_qr(pathbuf.path[i], quota_path); |
645 | 681 | keylen = strlen(key); |
646 | ||
647 | free(pathbuf.path[i]); | |
648 | 682 | |
649 | 683 | if (!goodp || goodp(rock, key, keylen, data, datalen)) { |
650 | 684 | /* make callback */ |
652 | 686 | if (r) break; |
653 | 687 | } |
654 | 688 | } |
689 | for (i = 0; i < pathbuf.count; i++) | |
690 | free(pathbuf.path[i]); | |
655 | 691 | |
656 | 692 | free(pathbuf.path); |
657 | 693 |
1807 | 1807 | db->fd = oldfd; |
1808 | 1808 | unlink(fname); |
1809 | 1809 | } |
1810 | ||
1811 | /* release old write lock */ | |
1812 | close(oldfd); | |
1813 | ||
1814 | { | |
1810 | else { | |
1815 | 1811 | 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); | |
1816 | 1818 | |
1817 | 1819 | /* let's make sure we're up to date */ |
1818 | 1820 | map_free(&db->map_base, &db->map_len); |
240 | 240 | /* Maximum number of transactions to be supported in the berkeley |
241 | 241 | environment. */ |
242 | 242 | |
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 | ||
243 | 249 | { "client_timeout", 10, INT } |
244 | 250 | /* Number of seconds to wait before returning a timeout failure when |
245 | 251 | performing a client connection (e.g., in a murder environment) */ |
292 | 298 | installations. Lists the old RFC 2086 right which was used to |
293 | 299 | grant the user the ability to delete a mailbox. If a user has this |
294 | 300 | 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' */ | |
295 | 311 | |
296 | 312 | { "disconnect_on_vanished_mailbox", 0, SWITCH } |
297 | 313 | /* If enabled, IMAP/POP3/NNTP clients will be disconnected by the |
596 | 612 | will cause the user's mailbox to exceed its quota. By default, the |
597 | 613 | failure won't occur until the mailbox is already over quota. */ |
598 | 614 | |
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 | ||
599 | 622 | { "lmtpsocket", "{configdirectory}/socket/lmtp", STRING } |
600 | 623 | /* Unix domain socket that lmtpd listens on, used by deliver(8). This should |
601 | 624 | 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. */ | |
602 | 631 | |
603 | 632 | # xxx how does this tie into virtual domains? |
604 | 633 | { "loginrealms", "", STRING } |
96 | 96 | { IMAPOPT_BERKELEY_TXNS_MAX, "berkeley_txns_max", 0, OPT_INT, |
97 | 97 | {(void*)100}, |
98 | 98 | { { NULL, IMAP_ENUM_ZERO } } }, |
99 | { IMAPOPT_BOUNDARY_LIMIT, "boundary_limit", 0, OPT_INT, | |
100 | {(void*)1000}, | |
101 | { { NULL, IMAP_ENUM_ZERO } } }, | |
99 | 102 | { IMAPOPT_CLIENT_TIMEOUT, "client_timeout", 0, OPT_INT, |
100 | 103 | {(void*)10}, |
101 | 104 | { { NULL, IMAP_ENUM_ZERO } } }, |
130 | 133 | { NULL, IMAP_ENUM_ZERO } } }, |
131 | 134 | { IMAPOPT_DELETERIGHT, "deleteright", 0, OPT_STRING, |
132 | 135 | {(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}, | |
133 | 142 | { { NULL, IMAP_ENUM_ZERO } } }, |
134 | 143 | { IMAPOPT_DISCONNECT_ON_VANISHED_MAILBOX, "disconnect_on_vanished_mailbox", 0, OPT_SWITCH, |
135 | 144 | {(void*)0}, |
346 | 355 | { IMAPOPT_LMTP_STRICT_QUOTA, "lmtp_strict_quota", 0, OPT_SWITCH, |
347 | 356 | {(void*)0}, |
348 | 357 | { { NULL, IMAP_ENUM_ZERO } } }, |
358 | { IMAPOPT_LMTP_STRICT_RFC2821, "lmtp_strict_rfc2821", 0, OPT_SWITCH, | |
359 | {(void*)1}, | |
360 | { { NULL, IMAP_ENUM_ZERO } } }, | |
349 | 361 | { IMAPOPT_LMTPSOCKET, "lmtpsocket", 0, OPT_STRING, |
350 | 362 | {(void *)("{configdirectory}/socket/lmtp")}, |
363 | { { NULL, IMAP_ENUM_ZERO } } }, | |
364 | { IMAPOPT_LMTPTXN_TIMEOUT, "lmtptxn_timeout", 0, OPT_INT, | |
365 | {(void*)300}, | |
351 | 366 | { { NULL, IMAP_ENUM_ZERO } } }, |
352 | 367 | { IMAPOPT_LOGINREALMS, "loginrealms", 0, OPT_STRING, |
353 | 368 | {(void *)("")}, |
36 | 36 | IMAPOPT_BERKELEY_CACHESIZE, |
37 | 37 | IMAPOPT_BERKELEY_LOCKS_MAX, |
38 | 38 | IMAPOPT_BERKELEY_TXNS_MAX, |
39 | IMAPOPT_BOUNDARY_LIMIT, | |
39 | 40 | IMAPOPT_CLIENT_TIMEOUT, |
40 | 41 | IMAPOPT_COMMANDMINTIMER, |
41 | 42 | IMAPOPT_CONFIGDIRECTORY, |
47 | 48 | IMAPOPT_DELETEDPREFIX, |
48 | 49 | IMAPOPT_DELETE_MODE, |
49 | 50 | IMAPOPT_DELETERIGHT, |
51 | IMAPOPT_DISABLE_USER_NAMESPACE, | |
52 | IMAPOPT_DISABLE_SHARED_NAMESPACE, | |
50 | 53 | IMAPOPT_DISCONNECT_ON_VANISHED_MAILBOX, |
51 | 54 | IMAPOPT_DUPLICATE_DB, |
52 | 55 | IMAPOPT_DUPLICATE_DB_PATH, |
110 | 113 | IMAPOPT_LMTP_FUZZY_MAILBOX_MATCH, |
111 | 114 | IMAPOPT_LMTP_OVER_QUOTA_PERM_FAILURE, |
112 | 115 | IMAPOPT_LMTP_STRICT_QUOTA, |
116 | IMAPOPT_LMTP_STRICT_RFC2821, | |
113 | 117 | IMAPOPT_LMTPSOCKET, |
118 | IMAPOPT_LMTPTXN_TIMEOUT, | |
114 | 119 | IMAPOPT_LOGINREALMS, |
115 | 120 | IMAPOPT_LOGINUSEACL, |
116 | 121 | IMAPOPT_LOGTIMESTAMPS, |
105 | 105 | case '@': |
106 | 106 | tok = parseaddr_domain(&s, &domain, &comment); |
107 | 107 | parseaddr_append(&addrp, comment, 0, phrase, domain, &freeme); |
108 | if (tok == ';') { | |
109 | parseaddr_append(&addrp, 0, 0, 0, 0, &freeme); | |
110 | ingroup = 0; | |
111 | } | |
108 | 112 | continue; |
109 | 113 | |
110 | 114 | case '<': |
263 | 263 | return 0; |
264 | 264 | } |
265 | 265 | |
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 | ||
266 | 277 | #ifdef HAVE_ZLIB |
267 | 278 | |
268 | 279 | #define ZLARGE_DIFF_CHUNK (5120) /* 5K */ |
195 | 195 | /* Set the SASL options for a protstream (requires authentication to |
196 | 196 | * be complete for the given sasl_conn_t */ |
197 | 197 | extern int prot_setsasl(struct protstream *s, sasl_conn_t *conn); |
198 | extern void prot_unsetsasl(struct protstream *s); | |
198 | 199 | |
199 | 200 | #ifdef HAVE_SSL |
200 | 201 | /* Set TLS options for a given protstream (requires a completed tls |
220 | 220 | .IP "\fBberkeley_txns_max:\fR 100" 5 |
221 | 221 | Maximum number of transactions to be supported in the berkeley |
222 | 222 | 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. | |
223 | 228 | .IP "\fBclient_timeout:\fR 10" 5 |
224 | 229 | Number of seconds to wait before returning a timeout failure when |
225 | 230 | performing a client connection (e.g., in a murder environment) |
264 | 269 | installations. Lists the old RFC 2086 right which was used to |
265 | 270 | grant the user the ability to delete a mailbox. If a user has this |
266 | 271 | 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' | |
267 | 280 | .IP "\fBdisconnect_on_vanished_mailbox:\fR 0" 5 |
268 | 281 | If enabled, IMAP/POP3/NNTP clients will be disconnected by the |
269 | 282 | server if the currently selected mailbox is (re)moved by another |
511 | 524 | If enabled, lmtpd returns a failure code when the incoming message |
512 | 525 | will cause the user's mailbox to exceed its quota. By default, the |
513 | 526 | 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. | |
514 | 533 | .IP "\fBlmtpsocket:\fR {configdirectory}/socket/lmtp" 5 |
515 | 534 | Unix domain socket that lmtpd listens on, used by deliver(8). This should |
516 | 535 | 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. | |
517 | 541 | .IP "\fBloginrealms:\fR <empty string>" 5 |
518 | 542 | The list of remote realms whose users may authenticate using cross-realm |
519 | 543 | authentication identifiers. Separate each realm name by a space. (A |
63 | 63 | [ |
64 | 64 | .B \-s |
65 | 65 | ] |
66 | [ | |
67 | .B \-o | |
68 | ] | |
66 | 69 | .br |
67 | 70 | [ |
68 | 71 | .BI \-d " days" |
128 | 131 | .TP |
129 | 132 | .B \-s |
130 | 133 | Skip over messages that have the \\Flagged flag set. |
134 | .TP | |
135 | .B \-o | |
136 | Only purge messages that have the \\Deleted flag set. | |
131 | 137 | .SH FILES |
132 | 138 | .TP |
133 | 139 | .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) | |
1 | 1 | .\" |
2 | 2 | .\" Standard preamble: |
3 | 3 | .\" ======================================================================== |
123 | 123 | .\" ======================================================================== |
124 | 124 | .\" |
125 | 125 | .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" | |
127 | 127 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
128 | 128 | .\" way too many mistakes in technical documents. |
129 | 129 | .if n .ad l |
1482 | 1482 | proto = NULL; /* avoid freeing it */ |
1483 | 1483 | |
1484 | 1484 | Services[i].exec = tokenize(cmd); |
1485 | cmd = NULL; /* avoid freeing it */ | |
1486 | 1485 | if (!Services[i].exec) fatal("out of memory", EX_UNAVAILABLE); |
1487 | 1486 | |
1488 | 1487 | /* is this service actually there? */ |
1535 | 1534 | Services[i].desired_workers, |
1536 | 1535 | Services[i].max_workers, |
1537 | 1536 | (int) Services[i].maxfds); |
1537 | ||
1538 | cmd = NULL; /* avoid freeing it */ | |
1538 | 1539 | |
1539 | 1540 | done: |
1540 | 1541 | free(cmd); |
519 | 519 | int r; |
520 | 520 | int optval = 1; |
521 | 521 | socklen_t optlen = sizeof(optval); |
522 | struct protoent *proto = getprotobyname("TCP"); | |
522 | 523 | |
523 | 524 | r = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen); |
524 | 525 | if (r < 0) { |
527 | 528 | #ifdef TCP_KEEPCNT |
528 | 529 | optval = config_getint(IMAPOPT_TCP_KEEPALIVE_CNT); |
529 | 530 | if (optval) { |
530 | r = setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &optval, optlen); | |
531 | r = setsockopt(fd, proto->p_proto, TCP_KEEPCNT, &optval, optlen); | |
531 | 532 | if (r < 0) { |
532 | 533 | syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPCNT): %m"); |
533 | 534 | } |
536 | 537 | #ifdef TCP_KEEPIDLE |
537 | 538 | optval = config_getint(IMAPOPT_TCP_KEEPALIVE_IDLE); |
538 | 539 | if (optval) { |
539 | r = setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &optval, optlen); | |
540 | r = setsockopt(fd, proto->p_proto, TCP_KEEPIDLE, &optval, optlen); | |
540 | 541 | if (r < 0) { |
541 | 542 | syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPIDLE): %m"); |
542 | 543 | } |
545 | 546 | #ifdef TCP_KEEPINTVL |
546 | 547 | optval = config_getint(IMAPOPT_TCP_KEEPALIVE_INTVL); |
547 | 548 | if (optval) { |
548 | r = setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &optval, optlen); | |
549 | r = setsockopt(fd, proto->p_proto, TCP_KEEPINTVL, &optval, optlen); | |
549 | 550 | if (r < 0) { |
550 | 551 | syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPINTVL): %m"); |
551 | 552 | } |
480 | 480 | if ((rc = pr_ListMembers(canon_id_tmp, &groups))) { |
481 | 481 | /* Failure may indicate that we need new tokens */ |
482 | 482 | pr_End(); |
483 | rc = pr_Initialize (1L, AFSCONF_CLIENTNAME, 0); | |
483 | rc = pr_Initialize (1L, AFSCONF_CLIENTNAME, config_getstring(IMAPOPT_AFSPTS_MYCELL)); | |
484 | 484 | if (rc) { |
485 | 485 | syslog(LOG_DEBUG, "pr_Initialize failed: %d", rc); |
486 | 486 | 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. */ | |
96 | 54 | #define YYPURE 0 |
97 | 55 | |
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 | ||
99 | 80 | /* |
100 | 81 | * addr.y -- RFC 822 address parser |
101 | 82 | * Ken Murchison |
164 | 145 | /* byacc default is 500, bison default is 10000 - go with the |
165 | 146 | larger to support big sieve scripts (see Bug #3461) */ |
166 | 147 | #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 | |
170 | 192 | 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. */ | |
174 | 1111 | #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; | |
178 | 1269 | # 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 | } | |
180 | 1289 | # 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 | ||
353 | 1621 | |
354 | 1622 | /* copy address error message into buffer provided by sieve parser */ |
355 | 1623 | int yyerror(char *s) |
359 | 1627 | strlcpy(addrerr, s, ADDRERR_SIZE); |
360 | 1628 | return 0; |
361 | 1629 | } |
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. */ | |
16 | 54 | #define YYPURE 0 |
17 | 55 | |
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 | ||
19 | 72 | /* sieve.y -- sieve parser |
20 | 73 | * Larry Greenfield |
21 | 74 | * |
188 | 241 | /* byacc default is 500, bison default is 10000 - go with the |
189 | 242 | larger to support big sieve scripts (see Bug #3461) */ |
190 | 243 | #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 */ | |
191 | 432 | #line 176 "sieve.y" |
192 | typedef union { | |
433 | ||
193 | 434 | int nval; |
194 | 435 | char *sval; |
195 | 436 | stringlist_t *sl; |
202 | 443 | struct btags *btag; |
203 | 444 | struct ntags *ntag; |
204 | 445 | struct dtags *dtag; |
446 | ||
447 | ||
448 | ||
449 | /* Line 214 of yacc.c */ | |
450 | #line 452 "y.tab.c" | |
205 | 451 | } 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. */ | |
208 | 1543 | #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; | |
212 | 1701 | # 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 | } | |
214 | 1721 | # 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")); | |
215 | 2903 | #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 | ||
641 | 3081 | commandlist_t *sieve_parse(sieve_script_t *script, FILE *f) |
642 | 3082 | { |
643 | 3083 | commandlist_t *t; |
1286 | 3726 | |
1287 | 3727 | return 1; |
1288 | 3728 | } |
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 | ||
74 | 201 | int nval; |
75 | 202 | char *sval; |
76 | 203 | stringlist_t *sl; |
83 | 210 | struct btags *btag; |
84 | 211 | struct ntags *ntag; |
85 | 212 | struct dtags *dtag; |
213 | ||
214 | ||
215 | ||
216 | /* Line 1676 of yacc.c */ | |
217 | #line 219 "y.tab.h" | |
86 | 218 | } YYSTYPE; |
219 | # define YYSTYPE_IS_TRIVIAL 1 | |
220 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ | |
221 | # define YYSTYPE_IS_DECLARED 1 | |
222 | #endif | |
223 | ||
87 | 224 | extern YYSTYPE yylval; |
225 | ||
226 |
82 | 82 | directory! */ |
83 | 83 | |
84 | 84 | extern int sieved_userisadmin; |
85 | char *sieve_dir = NULL; | |
85 | static char *sieve_dir_config = NULL; | |
86 | 86 | |
87 | 87 | static const char *sieved_userid = NULL; |
88 | 88 | |
93 | 93 | sieve_usehomedir = config_getswitch(IMAPOPT_SIEVEUSEHOMEDIR); |
94 | 94 | |
95 | 95 | if (!sieve_usehomedir) { |
96 | sieve_dir = (char *) config_getstring(IMAPOPT_SIEVEDIR); | |
96 | sieve_dir_config = (char *) config_getstring(IMAPOPT_SIEVEDIR); | |
97 | 97 | } else { |
98 | 98 | /* can't use home directories with timsieved */ |
99 | 99 | syslog(LOG_ERR, "can't use home directories"); |
107 | 107 | int actions_setuser(const char *userid) |
108 | 108 | { |
109 | 109 | char userbuf[1024], *user, *domain = NULL; |
110 | char *foo = sieve_dir; | |
111 | 110 | size_t size = 1024, len; |
112 | 111 | int result; |
113 | 112 | |
114 | sieve_dir = (char *) xzmalloc(size+1); | |
113 | char *sieve_dir = (char *) xzmalloc(size+1); | |
115 | 114 | |
116 | 115 | sieved_userid = xstrdup(userid); |
117 | 116 | user = (char *) userid; |
122 | 121 | if ((domain = strrchr(user, '@'))) *domain++ = '\0'; |
123 | 122 | } |
124 | 123 | |
125 | len = strlcpy(sieve_dir, foo, size); | |
124 | len = strlcpy(sieve_dir, sieve_dir_config, size); | |
126 | 125 | |
127 | 126 | if (domain) { |
128 | 127 | char dhash = (char) dir_hash_c(domain, config_fulldirhash); |
145 | 144 | if (!result) result = chdir(sieve_dir); |
146 | 145 | if (result) { |
147 | 146 | syslog(LOG_ERR, "mkdir %s: %m", sieve_dir); |
147 | free(sieve_dir); | |
148 | 148 | return TIMSIEVE_FAIL; |
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | free(sieve_dir); | |
152 | 153 | return TIMSIEVE_OK; |
153 | 154 | } |
154 | 155 | |
204 | 205 | if (tls_enabled() && !starttls_done && !authenticated) { |
205 | 206 | prot_printf(conn, "\"STARTTLS\"\r\n"); |
206 | 207 | } |
208 | prot_printf(conn, "\"UNAUTHENTICATE\"\r\n"); | |
207 | 209 | |
208 | 210 | prot_printf(conn,"OK\r\n"); |
209 | 211 | |
232 | 234 | |
233 | 235 | result = stat(path, &filestats); |
234 | 236 | 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"); | |
236 | 238 | return TIMSIEVE_NOEXIST; |
237 | 239 | } |
238 | 240 | size = filestats.st_size; |
315 | 317 | FILE *stream; |
316 | 318 | char *dataptr; |
317 | 319 | char *errstr; |
318 | int lup; | |
320 | int i; | |
321 | int last_was_r = 0; | |
319 | 322 | int result; |
320 | 323 | char path[1024], p2[1024]; |
321 | 324 | char bc_path[1024], bc_p2[1024]; |
339 | 342 | if (countscripts(string_DATAPTR(name))+1 > maxscripts) |
340 | 343 | { |
341 | 344 | 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", | |
343 | 346 | maxscripts); |
344 | 347 | return TIMSIEVE_FAIL; |
345 | 348 | } |
358 | 361 | |
359 | 362 | dataptr = string_DATAPTR(data); |
360 | 363 | |
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 | ||
371 | 381 | |
372 | 382 | /* let's make sure this is a valid script |
373 | 383 | (no parse errors) |
495 | 505 | |
496 | 506 | snprintf(path, 1023, "%s.script", string_DATAPTR(name)); |
497 | 507 | |
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; | |
500 | 511 | } |
501 | 512 | |
502 | 513 | result = unlink(path); |
503 | 514 | |
504 | 515 | 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"); | |
506 | 520 | return TIMSIEVE_FAIL; |
507 | 521 | } |
508 | 522 | |
609 | 623 | |
610 | 624 | if (exists(string_DATAPTR(name))==FALSE) |
611 | 625 | { |
612 | prot_printf(conn,"NO \"Script does not exist\"\r\n"); | |
626 | prot_printf(conn,"NO (NONEXISTENT) \"Script does not exist\"\r\n"); | |
613 | 627 | return TIMSIEVE_NOEXIST; |
614 | 628 | } |
615 | 629 | |
666 | 680 | if (num > maxscriptsize) |
667 | 681 | { |
668 | 682 | prot_printf(conn, |
669 | "NO (\"QUOTA\") \"Script size is too large. " | |
683 | "NO (QUOTA/MAXSIZE) \"Script size is too large. " | |
670 | 684 | "Max script size is %ld bytes\"\r\n", |
671 | 685 | maxscriptsize); |
672 | 686 | return TIMSIEVE_FAIL; |
678 | 692 | if (countscripts(string_DATAPTR(sieve_name))+1 > maxscripts) |
679 | 693 | { |
680 | 694 | 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", | |
682 | 696 | maxscripts); |
683 | 697 | return TIMSIEVE_FAIL; |
684 | 698 | } |
81 | 81 | case 'g': |
82 | 82 | if (strcmp(str, "getscript")==0) return GETSCRIPT; |
83 | 83 | break; |
84 | ||
84 | 85 | case 'h': |
85 | 86 | if (strcmp(str, "havespace")==0) return HAVESPACE; |
86 | 87 | break; |
88 | 89 | case 'l': |
89 | 90 | if (strcmp(str, "listscripts")==0) return LISTSCRIPTS; |
90 | 91 | if (strcmp(str, "logout")==0) return LOGOUT; |
92 | break; | |
93 | ||
94 | case 'n': | |
95 | if (strcmp(str, "noop")==0) return NOOP; | |
91 | 96 | break; |
92 | 97 | |
93 | 98 | case 'p': |
98 | 103 | if (strcmp(str, "setactive")==0) return SETACTIVE; |
99 | 104 | if (strcmp(str, "starttls")==0 && tls_enabled()) |
100 | 105 | return STARTTLS; |
106 | break; | |
107 | ||
108 | case 'u': | |
109 | if (strcmp(str, "unauthenticate")==0) return UNAUTHENTICATE; | |
101 | 110 | break; |
102 | 111 | } |
103 | 112 |
79 | 79 | #define CAPABILITY 407 |
80 | 80 | #define HAVESPACE 408 |
81 | 81 | #define STARTTLS 409 |
82 | #define NOOP 410 | |
83 | #define UNAUTHENTICATE 411 | |
82 | 84 | |
83 | 85 | |
84 | 86 | int lex_init(void); |
100 | 100 | struct protstream *sieved_in); |
101 | 101 | static int cmd_authenticate(struct protstream *sieved_out, struct protstream *sieved_in, |
102 | 102 | 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); | |
103 | 105 | static int cmd_starttls(struct protstream *sieved_out, struct protstream *sieved_in); |
104 | 106 | |
105 | 107 | static char *sieve_parsesuccess(char *str, const char **status) |
151 | 153 | |
152 | 154 | if (!authenticated && (token > 255) && (token!=AUTHENTICATE) && |
153 | 155 | (token!=LOGOUT) && (token!=CAPABILITY) && |
156 | (token!=NOOP) && | |
154 | 157 | (!tls_enabled() || (token!=STARTTLS))) |
155 | 158 | { |
156 | 159 | error_msg = "Authenticate first"; |
452 | 455 | cmd_starttls(sieved_out, sieved_in); |
453 | 456 | |
454 | 457 | 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; | |
455 | 509 | |
456 | 510 | default: |
457 | 511 | error_msg="Expected a command. Got something else."; |
514 | 568 | static char *authid = NULL; |
515 | 569 | |
516 | 570 | 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 | } | |
517 | 583 | |
518 | 584 | static int cmd_authenticate(struct protstream *sieved_out, |
519 | 585 | struct protstream *sieved_in, |