diff -u -r zmailer-2.99.48p4/Makefile.in zmailer-2.99.48p5/Makefile.in --- zmailer-2.99.48p4/Makefile.in Tue Jun 17 17:19:17 1997 +++ zmailer-2.99.48p5/Makefile.in Tue Jun 17 17:18:32 1997 @@ -2,7 +2,7 @@ MAJORVERSION = 2 MINORVERSION = 99 -PATCHLEVEL = 48p4 +PATCHLEVEL = 48p5 srcdir = @srcdir@ VPATH = @srcdir@ diff -u -r zmailer-2.99.48p4/configure.in zmailer-2.99.48p5/configure.in --- zmailer-2.99.48p4/configure.in Fri Jun 13 23:46:44 1997 +++ zmailer-2.99.48p5/configure.in Thu Jun 19 10:25:55 1997 @@ -235,22 +235,22 @@ use_system_malloc=1) AC_ARG_WITH(libmalloc, [ --with-libmalloc=LIBNAME define the name of the malloc library - possible values: system, malloc_d, malloc (default)], + possible values: malloc, malloc_d, system (default)], use_libmalloc=1) if test "x$use_system_malloc" = x1 ; then LIBMALLOC="" MALLOC="system" else - if test "x$withval" = xsystem ; then - LIBMALLOC="" - MALLOC="system" + if test "x$withval" = xmalloc_d -o "x$withval" = xmalloc ; then + LIBMALLOC="-l$withval" + MALLOC="$withval" + if text "$withval" = "malloc_d" ; then + MALLOCEXT="_d" + fi else - if test "x$withval" = xmalloc_d -o "x$withval" = xmalloc ; then - LIBMALLOC="-l$withval" - MALLOC="$withval" - if text "$withval" = "malloc_d" ; then - MALLOCEXT="_d" - fi + if test "x$withval" = xsystem -o "x$use_libmalloc" != x1; then + LIBMALLOC=""; MALLOCEXT="" + MALLOC="system" else eval LIBMALLOC="-l${MALLOC-malloc}" if test "x$LIBMALLOC" = "x-lmalloc_d"; then @@ -1469,6 +1469,7 @@ ssl/Makefile doc/design/Makefile \ include/mail.h man/Makefile \ utils/zmailer.init.sh utils/autoanswer.pl \ + utils/policy-builder.sh \ proto/Makefile proto/zmailer.sh \ proto/newaliases proto/newfqdnaliases \ proto/mailrm.sh proto/db/Makefile \ diff -u -r zmailer-2.99.48p4/lib/selfaddrs.c zmailer-2.99.48p5/lib/selfaddrs.c --- zmailer-2.99.48p4/lib/selfaddrs.c Tue Jun 17 17:19:18 1997 +++ zmailer-2.99.48p5/lib/selfaddrs.c Thu Jun 19 10:49:42 1997 @@ -32,7 +32,7 @@ #ifdef HAVE_SYS_SOCKET_H #include #endif -#if defined(__svr4__) && defined(__sun) +#if (defined(__svr4__) || defined(__SVR4)) && defined(__sun) # define BSD_COMP /* Damn Solaris, and its tricks... */ #endif #include diff -u -r zmailer-2.99.48p4/proto/cf/canon.cf zmailer-2.99.48p5/proto/cf/canon.cf --- zmailer-2.99.48p4/proto/cf/canon.cf Thu Feb 6 19:04:59 1997 +++ zmailer-2.99.48p5/proto/cf/canon.cf Mon Jun 16 01:25:01 1997 @@ -16,14 +16,18 @@ canonicalize (address) { # -- stringwise sift - ssift "$address" in - \|.+ echo $address ; return ;; # pass through - tfiss - # -- tokenized sift - sift "$address" in + #ssift "$address" in + #\|.+ echo $address ; return ;; # pass through + #tfiss + + ## -- tokenized sift + + tsift "$address" in # preliminaries <> echo @ ; return ;; # turn into magic token :include:.+ echo $address ; return ;; # pass through + '"'(.*)'"'<(.*)>(.*) + address=\1\2\3 ;; # defocus (.*)<(.*)>(.*) address=\1\2\3 ;; # defocus # Reversed JANET addresses... @@ -64,7 +68,7 @@ (.+)%([^%]+) focus "\1<@\2>" ; return ;; # official %-kludge ([^:]+):(.+) focus "\2<@\1>" ; return ;; # berknet syntax # (.)\=(.+) focus "\2<@\1.bitnet>" ; return ;; # bitnet kludge - tfis + tfist echo "$address" } # end of canonicalize diff -u -r zmailer-2.99.48p4/proto/cf/rrouter.cf zmailer-2.99.48p5/proto/cf/rrouter.cf --- zmailer-2.99.48p4/proto/cf/rrouter.cf Fri May 2 13:11:01 1997 +++ zmailer-2.99.48p5/proto/cf/rrouter.cf Mon Jun 16 01:25:01 1997 @@ -26,17 +26,39 @@ address="$(condquote "$address")" - tsift "$address" in - # See that it does not start with a pipe ... - [|].+ # Looks like a pipe... Don't mutilate it! - break ;; + # + # We have troublesome addresses coming here... + # "|pipe-program" + # "|quoted string"@domain + # "foo > faa"@domain + # "fii < fuu"@domain + # "foo @ faa"@domain + # "|foo @ faa" + # and we want to do correct focusing.. + # + + ssift "$address" in # Now make canonical - (.*)<(.*) + '"'(.*)'"'<(.*) + address="\1\2" # defocus + ;; + '"'(.*)'"'>(.*) + address="\1\2" # defocus + break ;; + ([\'"'].*[\'"'])<(.*) address="\1\2" ;; # defocus - (.*)>(.*) + ([\'"'].*[\'"'])>(.*) address="\1\2" ;; # defocus - .* - address=$(canonicalize "$address") ;; + # See that it does not start with a pipe ... +# \|.+ # Looks like a pipe... Don't mutilate it! +# break ;; +# '"'[|].+ # Quoted pipe ?? What the ... ?? +# break ;; + tfiss + + address=$(canonicalize "$address") + + ssift "$address" in # (.*) # return (((error vms-in-pros "in%\1" $A))) ;; # (.*)<@(.+)\.uucp>(.*) @@ -108,7 +130,7 @@ domain="$mydomain" fi return $(rrouter "\1$plustail" "$origaddr" $A "" "$domain") ;; # strip trash & retry - tfist + tfiss #log "BITNET name=$bitnetname, address=$address" case $bitnetname in diff -u -r zmailer-2.99.48p4/router/functions.c zmailer-2.99.48p5/router/functions.c --- zmailer-2.99.48p4/router/functions.c Mon Mar 31 03:13:55 1997 +++ zmailer-2.99.48p5/router/functions.c Tue Jun 17 16:12:43 1997 @@ -2430,8 +2430,11 @@ char *argv[]; { int len; - char *s = argv[1]; - char *sp, *bs; + const char *s = argv[1]; + const char *sp, *bs; + int mustquote = 0; + int candequote = 0; + int c; /* We remove quotes when they are not needed, and add them when they really are needed! */ @@ -2439,24 +2442,43 @@ if (argc != 2) return 2; /* Bad bad! Missing/extra arg! */ - len = strlen(s); - - sp = strchr(s,' '); /* White space ? */ - if (!sp) sp = strchr(s,'\t'); + c = *s; + if (c == '"') { + ++s; /* Starting quote */ + while (*s && *s != '"') { + /* While within quoted string */ + if (*s == '\\') + ++s; + if (*s != 0) + ++s; + } + if (*s != '"') + mustquote = 1; + else if (*s == 0) + candequote = 1; + } + while (*s) { + if (c == '\\') { + ++s; + c = *s; + } else if (c == ' ' || c == '\t') + mustquote = 1; /* Unquoted spaces! */ + if (c != 0) + ++s; + } - bs = strchr(s,'\\'); /* Backslashes ? */ + s = argv[1]; + len = strlen(s); /* Quoted, and without a need for quotes */ - if ((*s == '"' && s[len-1] == '"' ) && !sp && !bs) { + if (candequote) { /* XXX: THIS SHOULD REALLY USE SOME SYNTAX SCANNER -- LIKE THAT ONE FOR SMTP: RFC821SCN() */ - s = argv[1]; - s[len-1] = 0; - ++s; - printf("%s\n",s); /* Dequoted! */ + fwrite(argv[1] + 1, 1, len -2, stdout); /* Dequoted! */ + putc('\n', stdout); return 0; } - if (!(*s == '"' && s[len-1] == '"' ) && (sp || bs)) { + if (mustquote) { /* We need to quote this */ s = argv[1]; putchar('"'); /* First quote */ diff -u -r zmailer-2.99.48p4/transports/libta/diagnostic.c zmailer-2.99.48p5/transports/libta/diagnostic.c --- zmailer-2.99.48p4/transports/libta/diagnostic.c Tue Jun 17 17:19:18 1997 +++ zmailer-2.99.48p5/transports/libta/diagnostic.c Tue Jun 17 16:14:28 1997 @@ -278,7 +278,7 @@ /* Right, we have a honour to append our diagnostics to the transport specification file ourselves */ int oldfl = fcntl(rp->desc->ctlfd, F_GETFL); - int len = 80 + strlen(notarybuf) + strlen(message); + int len = 80 + strlen(notarybuf ? notarybuf : "") + strlen(message); int rc; long oldalarm; char *sbuf; @@ -302,7 +302,7 @@ sprintf(sbuf, "%c%c%ld:%ld:%ld::%ld\t%s\t%s\n", _CF_DIAGNOSTIC, _CFTAG_NORMAL, rp->id, rp->headeroffset, rp->drptoffset, - time(NULL), notarybuf, message); + time(NULL), notarybuf ? notarybuf : "", message); /* #ifdef SPRINTF_CHAR */ /* If the autoconfig fails, we are in DEEP trouble, and the 'len' variable in uninitialized.. */ @@ -330,7 +330,8 @@ fcntl(rp->desc->ctlfd, F_SETFL, oldfl); /* Now we have no reason to send also the NOTARY report up.. */ - *notarybuf = 0; + if (notarybuf) + *notarybuf = 0; } printf("%d/%ld\t%s\t%s %s\n", diff -u -r zmailer-2.99.48p4/configure zmailer-2.99.48p5/configure --- zmailer-2.99.48p4/configure Fri Jun 13 23:46:45 1997 +++ zmailer-2.99.48p5/configure Thu Jun 19 12:09:46 1997 @@ -36,7 +36,7 @@ --with-system-malloc use system malloc instead of our own" ac_help="$ac_help --with-libmalloc=LIBNAME define the name of the malloc library - possible values: system, malloc_d, malloc (default)" + possible values: malloc, malloc_d, system (default)" ac_help="$ac_help --with-sendmailpath=PATH The location of the 'sendmail'" ac_help="$ac_help @@ -2177,16 +2177,16 @@ LIBMALLOC="" MALLOC="system" else - if test "x$withval" = xsystem ; then - LIBMALLOC="" - MALLOC="system" + if test "x$withval" = xmalloc_d -o "x$withval" = xmalloc ; then + LIBMALLOC="-l$withval" + MALLOC="$withval" + if text "$withval" = "malloc_d" ; then + MALLOCEXT="_d" + fi else - if test "x$withval" = xmalloc_d -o "x$withval" = xmalloc ; then - LIBMALLOC="-l$withval" - MALLOC="$withval" - if text "$withval" = "malloc_d" ; then - MALLOCEXT="_d" - fi + if test "x$withval" = xsystem -o "x$use_libmalloc" != x1; then + LIBMALLOC=""; MALLOCEXT="" + MALLOC="system" else eval LIBMALLOC="-l${MALLOC-malloc}" if test "x$LIBMALLOC" = "x-lmalloc_d"; then @@ -8211,6 +8211,7 @@ ssl/Makefile doc/design/Makefile \ include/mail.h man/Makefile \ utils/zmailer.init.sh utils/autoanswer.pl \ + utils/policy-builder.sh \ proto/Makefile proto/zmailer.sh \ proto/newaliases proto/newfqdnaliases \ proto/mailrm.sh proto/db/Makefile \ @@ -8359,6 +8360,7 @@ ssl/Makefile doc/design/Makefile \ include/mail.h man/Makefile \ utils/zmailer.init.sh utils/autoanswer.pl \ + utils/policy-builder.sh \ proto/Makefile proto/zmailer.sh \ proto/newaliases proto/newfqdnaliases \ proto/mailrm.sh proto/db/Makefile \