home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-01-31 | 44.7 KB | 1,655 lines |
- Newsgroups: comp.sources.misc
- From: Raphael Manfredi <ram@acri.fr>
- Subject: v41i124: mailagent - Flexible mail filtering and processing package, v3.0, Patch05
- Message-ID: <1994Feb1.065357.15004@sparky.sterling.com>
- X-Md4-Signature: 3a43d4203487479c3e7d9d8bd5f61109
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Advanced Computer Research Institute, Lyon, France
- Date: Tue, 1 Feb 1994 06:53:57 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: Raphael Manfredi <ram@acri.fr>
- Posting-number: Volume 41, Issue 124
- Archive-name: mailagent/patch05
- Environment: UNIX, Perl
- Patch-To: mailagent: Volume 41, Issue 1-26
-
- [The latest patch for mailagent version 3.0 is #6.]
-
- System: mailagent version 3.0
- Patch #: 5
- Priority: LOW
- Subject: updated Configure with newer metaconfig
- Subject: Configure now knows about agent-users list
- Subject: updated Credits file
- Subject: now only try to include <sys/fcntl.h> when hope is lost
- Subject: filter will now put itself in daemon state while waiting
- Subject: typo fix in a comment
- Subject: new -F option to force procesing on filtered messages
- Subject: documents new tag feature for UNIQUE and RECORD
- Subject: documents new -F option
- Subject: random typo fixes
- Subject: restored ability to use Cc: and Bcc: in message files
- Subject: now understands new -F option to force processing
- Subject: added tags to UNIQUE and RECORD commands
- Subject: history can now handle distinct tags on messages
- Subject: added new tests for UNIQUE and RECORD tags
- Subject: ensure header-added recipients looked for in messages
- Subject: added tests for tag support
- Subject: created
- Subject: updated by metaconfig
- Subject: one new file
- Date: Wed Jan 26 10:36:52 MET 1994
- From: Raphael Manfredi <ram@acri.fr>
-
- Description:
- Updated Configure with newer metaconfig. It now knows about
- the agent-users list and will offer the user to subscribe
- or unsubscribe from it.
-
- Updated Credits file and thanks to Harald Koch
- <chk@enfm.utcc.utoronto.ca> for suggesting that filter
- should put itself in daemon state while waiting. That allows
- processes to see EOF on pipes. See comment in agent/filter/io.c.
-
- New -F option to force procesing on filtered messages, at the
- request of Shigeya Suzuki <shigeya@foretune.co.jp>. This allows
- you to post-process already filtered mail.
-
- Restored ability to use Cc: and Bcc: in message files. This
- documented feature was lost when I suppressed invocation to
- sendmail -t for sending message. Since now the mailer can be
- configured from within ~/.mailagent, the burden of doing this
- falls on mailagent's shoulders.
-
- Regression tests now explicitely check for the above problem,
- hence ensuring failure if this documented feature is broken
- again at some later time...
-
- Added tags to UNIQUE and RECORD commands, again at the
- request of Shigeya Suzuki <shigeya@foretune.co.jp>. Message
- history can now handle distinct tags on messages
-
- Added the necessary regression tests for -F and those new
- tags in UNIQUE and RECORD, along with the documentation that
- comes with those new features.
-
-
- Fix: From rn, say "| patch -p -N -d DIR", where DIR is your mailagent source
- directory. Outside of rn, say "cd DIR; patch -p -N <thisarticle".
- If you don't have the patch program, apply the following by hand,
- or get patch (version 2.0, latest patchlevel).
-
- After patching:
- *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #6 FIRST ***
-
- If patch indicates that patchlevel is the wrong version, you may need
- to apply one or more previous patches, or the patch may already
- have been applied. See the patchlevel.h file to find out what has or
- has not been applied. In any event, don't continue with the patch.
-
- If you are missing previous patches they can be obtained from me:
-
- Raphael Manfredi <ram@acri.fr>
-
- If you send a mail message of the following form it will greatly speed
- processing:
-
- Subject: Command
- @SH mailpatch PATH mailagent 3.0 LIST
- ^ note the c
-
- where PATH is a return path FROM ME TO YOU either in Internet notation,
- or in bang notation from some well-known host, and LIST is the number
- of one or more patches you need, separated by spaces, commas, and/or
- hyphens. Saying 35- says everything from 35 to the end.
-
- To get some more detailed instructions, send me the following mail:
-
- Subject: Command
- @SH mailhelp PATH
-
-
- Index: patchlevel.h
- Prereq: 4
- 4c4
- < #define PATCHLEVEL 4
- ---
- > #define PATCHLEVEL 5
-
- Index: Configure
- Prereq: 3.0.1.2
- *** Configure.old Wed Jan 26 10:36:31 1994
- --- Configure Wed Jan 26 10:36:33 1994
- ***************
- *** 18,26 ****
- # archive site. Check with Archie if you don't know where that can be.)
- #
-
- ! # $Id: Configure,v 3.0.1.2 1993/12/15 09:02:26 ram Exp $
- #
- ! # Generated on Wed Dec 15 09:55:57 MET 1993 [metaconfig 3.0 PL15]
-
- cat >/tmp/c1$$ <<EOF
- ARGGGHHHH!!!!!
- --- 18,26 ----
- # archive site. Check with Archie if you don't know where that can be.)
- #
-
- ! # $Id: Configure,v 3.0.1.3 1994/01/26 09:24:20 ram Exp $
- #
- ! # Generated on Mon Jan 24 17:53:52 MET 1994 [metaconfig 3.0 PL22]
-
- cat >/tmp/c1$$ <<EOF
- ARGGGHHHH!!!!!
- ***************
- *** 176,181 ****
- --- 176,182 ----
- ldflags=''
- lkflags=''
- optimize=''
- + cf_email=''
- cf_by=''
- cf_time=''
- contains=''
- ***************
- *** 194,199 ****
- --- 195,204 ----
- d_open3=''
- d_portable=''
- d_rename=''
- + d_setpgid=''
- + d_bsdpgrp=''
- + d_setpgrp=''
- + d_setsid=''
- d_index=''
- d_strchr=''
- d_strerrm=''
- ***************
- *** 202,207 ****
- --- 207,213 ----
- d_syserrlst=''
- d_time=''
- timetype=''
- + d_uwait3=''
- d_uwait=''
- d_vfork=''
- d_voidsig=''
- ***************
- *** 212,218 ****
- --- 218,231 ----
- i_string=''
- strings=''
- i_sysfile=''
- + d_voidtty=''
- + i_bsdioctl=''
- + i_sysioctl=''
- + i_syssockio=''
- i_syswait=''
- + i_sgtty=''
- + i_termio=''
- + i_termios=''
- i_systime=''
- i_systimek=''
- i_time=''
- ***************
- *** 247,252 ****
- --- 260,269 ----
- phostname=''
- c=''
- n=''
- + d_berknames=''
- + d_passnames=''
- + d_usgnames=''
- + nametype=''
- groupcat=''
- hostcat=''
- passcat=''
- ***************
- *** 417,423 ****
- -s) shift; silent=true;;
- -E) shift; alldone=exit;;
- -S) shift; extractsh=true;;
- ! -V) echo "Configure generated by metaconfig 3.0 PL15." >&2
- exit 0;;
- --) break;;
- -*) echo "Configure: unknown option $1" >&2; shift; error=true;;
- --- 434,440 ----
- -s) shift; silent=true;;
- -E) shift; alldone=exit;;
- -S) shift; extractsh=true;;
- ! -V) echo "Configure generated by metaconfig 3.0 PL22." >&2
- exit 0;;
- --) break;;
- -*) echo "Configure: unknown option $1" >&2; shift; error=true;;
- ***************
- *** 1001,1006 ****
- --- 1018,1025 ----
- case "$config_sh" in
- '')
- myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
- + myuname=`echo $myuname | $sed -e 's/^[^=]*=//' | \
- + tr '[A-Z]' '[a-z]' | tr '\012' ' '`
- dflt=n
- if test "$fastread" = yes; then
- dflt=y
- ***************
- *** 1018,1024 ****
- hint=default
- if test -f ../config.sh; then
- echo " "
- ! rp="I see a config.sh file. Did Configure make it on THIS system?"
- . ./myread
- case "$ans" in
- n*|N*) echo "OK, I'll ignore it.";;
- --- 1037,1043 ----
- hint=default
- if test -f ../config.sh; then
- echo " "
- ! rp="I see a config.sh file. Shall I use it to set the defaults?"
- . ./myread
- case "$ans" in
- n*|N*) echo "OK, I'll ignore it.";;
- ***************
- *** 2207,2212 ****
- --- 2226,2284 ----
- set bcopy d_bcopy
- eval $inlibc
-
- + : function used to set $1 to $val
- + setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
- + case "$val$was" in
- + $define$undef) . whoa; eval "$var=\$td";;
- + $undef$define) . whoa; eval "$var=\$tu";;
- + *) eval "$var=$val";;
- + esac'
- +
- + : see if setpgrp exists
- + set setpgrp d_setpgrp
- + eval $inlibc
- +
- + : see which flavor of setpgrp is in use
- + case "$d_setpgrp" in
- + "$define")
- + echo " "
- + $cat >set.c <<EOP
- + main()
- + {
- + if (getuid() == 0) {
- + printf("(I see you are running Configure as super-user...)\n");
- + setuid(1);
- + }
- + if (-1 == setpgrp(1, 1))
- + exit(1);
- + exit(0);
- + }
- + EOP
- + if $cc $ccflags -o set set.c $libs >/dev/null 2>&1; then
- + ./set 2>/dev/null
- + case $? in
- + 0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
- + val="$undef";;
- + *) echo "You have to use setpgrp(pid, pgrp) instead of setpgrp()." >&4
- + val="$define";;
- + esac
- + else
- + if usg; then
- + xxx="USG one, i.e. you use setpgrp()."
- + val="$undef"
- + else
- + xxx="BSD one, i.e. you use setpgrp(pid, pgrp)."
- + val="$define"
- + fi
- + echo "Assuming your setpgrp is a $xxx" >&4
- + fi
- + ;;
- + *) val="$undef";;
- + esac
- + set d_bsdpgrp
- + eval $setvar
- + $rm -f set set.c
- +
- : see if we have to deal with yellow pages, now NIS.
- if $test -d /usr/etc/yp || $test -d /etc/yp; then
- if $test -f /usr/etc/nibindd; then
- ***************
- *** 2213,2218 ****
- --- 2285,2306 ----
- echo " "
- echo "I'm fairly confident you're on a NeXT."
- echo " "
- + rp='Do you get the passwd file via NetInfo?'
- + dflt=y
- + case "$passcat" in
- + nidump*) ;;
- + '') ;;
- + *) dflt=n;;
- + esac
- + . ./myread
- + case "$ans" in
- + y*) passcat='nidump passwd .'
- + ;;
- + *) echo "You told me, so don't blame me."
- + passcat='cat /etc/passwd'
- + ;;
- + esac
- + echo " "
- rp='Do you get the hosts file via NetInfo?'
- dflt=y
- case "$hostcat" in
- ***************
- *** 2226,2231 ****
- --- 2314,2342 ----
- *) hostcat='cat /etc/hosts';;
- esac
- fi
- + case "$passcat" in
- + nidump*) ;;
- + *)
- + case "$passcat" in
- + *ypcat*) dflt=y;;
- + '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
- + dflt=y
- + else
- + dflt=n
- + fi;;
- + *) dflt=n;;
- + esac
- + echo " "
- + rp='Are you getting the passwd file via yellow pages?'
- + . ./myread
- + case "$ans" in
- + y*) passcat='ypcat passwd'
- + ;;
- + *) passcat='cat /etc/passwd'
- + ;;
- + esac
- + ;;
- + esac
- case "$hostcat" in
- nidump*) ;;
- *)
- ***************
- *** 2502,2515 ****
- '') d_phostname="$undef";;
- esac
-
- - : function used to set $1 to $val
- - setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
- - case "$val$was" in
- - $define$undef) . whoa; eval "$var=\$td";;
- - $undef$define) . whoa; eval "$var=\$tu";;
- - *) eval "$var=$val";;
- - esac'
- -
- : see how we invoke the C preprocessor
- echo " "
- echo "Now, how can we feed standard input to your C preprocessor..." >&4
- --- 2613,2618 ----
- ***************
- *** 2823,2828 ****
- --- 2926,2939 ----
- set rename d_rename
- eval $inlibc
-
- + : see if setpgid exists
- + set setpgid d_setpgid
- + eval $inlibc
- +
- + : see if setsid exists
- + set setsid d_setsid
- + eval $inlibc
- +
- : see if strerror and/or sys_errlist[] exist
- echo " "
- if set strerror val -f d_strerror; eval $csym; $val; then
- ***************
- *** 2869,2883 ****
-
- : see if union wait is available
- echo " "
- ! if $contains 'union.*wait.*{' `./findhdr sys/wait.h` >/dev/null 2>&1 ; then
- ! echo "Looks like we have to use 'union wait' pointer for wait()." >&4
- val="$define"
- else
- ! echo "Your wait() should be happy with a plain 'int' pointer." >&4
- val="$undef"
- fi
- set d_uwait
- eval $setvar
-
- : backward compatibility for d_hvfork
- if test X$d_hvfork != X; then
- --- 2980,3020 ----
-
- : see if union wait is available
- echo " "
- ! set X $cppflags
- ! shift
- ! flags=''
- ! also=''
- ! for f in $*; do
- ! case "$f" in
- ! *NO_PROTO*) ;;
- ! *) flags="$flags $f";;
- ! esac
- ! done
- ! $cat `./findhdr sys/wait.h` /dev/null | \
- ! $cppstdin $flags $cppminus >wait.out 2>/dev/null
- ! if $contains 'union.*wait.*{' wait.out >/dev/null 2>&1 ; then
- ! echo "Looks like your <sys/wait.h> knows about 'union wait'..." >&4
- val="$define"
- + also='also '
- + if $contains 'extern.*wait[ ]*([ ]*int' wait.out >/dev/null 2>&1
- + then
- + echo "But wait() seems to expect an 'int' pointer (POSIX way)." >&4
- + val="$undef"
- + also=''
- + elif $contains 'extern.*wait[ ]*([ ]*union' wait.out >/dev/null 2>&1
- + then
- + echo "And indeed wait() expects an 'union wait' pointer (BSD way)." >&4
- + else
- + echo "So we'll use that for wait()." >&4
- + fi
- else
- ! echo "No trace of 'union wait' in <sys/wait.h>..." >&4
- val="$undef"
- + echo "Your wait() should be happy with a plain 'int' pointer." >&4
- fi
- set d_uwait
- eval $setvar
- + $rm -f wait.out
-
- : backward compatibility for d_hvfork
- if test X$d_hvfork != X; then
- ***************
- *** 2888,2893 ****
- --- 3025,3182 ----
- set vfork d_vfork
- eval $inlibc
-
- + : get C preprocessor symbols handy
- + echo " "
- + echo $attrlist | $tr ' ' '\012' >Cppsym.know
- + $cat <<EOSS >Cppsym
- + $startsh
- + case "\$1" in
- + -l) list=true
- + shift
- + ;;
- + esac
- + unknown=''
- + case "\$list\$#" in
- + 1|2)
- + for sym do
- + if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
- + exit 0
- + elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
- + :
- + else
- + unknown="\$unknown \$sym"
- + fi
- + done
- + set X \$unknown
- + shift
- + ;;
- + esac
- + case \$# in
- + 0) exit 1;;
- + esac
- + echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
- + #ifdef \1\\
- + exit 0; _ _ _ _\1\\ \1\\
- + #endif\\
- + /' >Cppsym\$\$
- + echo "exit 1; _ _ _" >>Cppsym\$\$
- + $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
- + case "\$list" in
- + true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
- + *)
- + sh Cppsym2\$\$
- + status=\$?
- + ;;
- + esac
- + $rm -f Cppsym\$\$ Cppsym2\$\$
- + exit \$status
- + EOSS
- + chmod +x Cppsym
- + $eunicefix Cppsym
- + echo "Your C preprocessor defines the following symbols:"
- + Cppsym -l $attrlist >Cppsym.true
- + $cat Cppsym.true
- +
- + : see if this is a termio system
- + val="$undef"
- + val2="$undef"
- + val3="$undef"
- + if $test `./findhdr termios.h`; then
- + set tcsetattr i_termios
- + eval $inlibc
- + val3="$i_termios"
- + fi
- + echo " "
- + case "$val3" in
- + "$define") echo "You have POSIX termios.h... good!" >&4;;
- + *) if Cppsym pyr; then
- + case "`/bin/universe`" in
- + ucb) if $test `./findhdr sgtty.h`; then
- + val2="$define"
- + echo "<sgtty.h> found." >&4
- + else
- + echo "System is pyramid with BSD universe."
- + echo "<sgtty.h> not found--you could have problems." >&4
- + fi;;
- + *) if $test `./findhdr termio.h`; then
- + val="$define"
- + echo "<termio.h> found." >&4
- + else
- + echo "System is pyramid with USG universe."
- + echo "<termio.h> not found--you could have problems." >&4
- + fi;;
- + esac
- + elif usg; then
- + if $test `./findhdr termio.h`; then
- + echo "<termio.h> found." >&4
- + val="$define"
- + elif $test `./findhdr sgtty.h`; then
- + echo "<sgtty.h> found." >&4
- + val2="$define"
- + else
- + echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
- + fi
- + else
- + if $test `./findhdr sgtty.h`; then
- + echo "<sgtty.h> found." >&4
- + val2="$define"
- + elif $test `./findhdr termio.h`; then
- + echo "<termio.h> found." >&4
- + val="$define"
- + else
- + echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
- + fi
- + fi;;
- + esac
- + set i_termio; eval $setvar
- + val=$val2; set i_sgtty; eval $setvar
- + val=$val3; set i_termios; eval $setvar
- +
- + : see if ioctl defs are in sgtty/termio or sys/ioctl
- + echo " "
- + if $test `./findhdr sys/ioctl.h`; then
- + val="$define"
- + echo "<sys/ioctl.h> found." >&4
- + else
- + val="$undef"
- + $test $i_termio = "$define" && xxx="termio.h"
- + $test $i_termios = "$define" && xxx="termios.h"
- + $test $i_sgtty = "$define" && xxx="sgtty.h"
- + echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
- + fi
- + set i_sysioctl
- + eval $setvar
- +
- + : check how to void tty association
- + echo " "
- + case "$i_sysioctl" in
- + "$define") xxx='sys/ioctl.h';;
- + esac
- + $cat > tcio.c <<EOM
- + #include <sys/types.h> /* Just in case */
- + #include <$xxx>
- +
- + main()
- + {
- + #ifdef TIOCNOTTY
- + exit(0);
- + #else
- + exit(1);
- + #endif
- + }
- + EOM
- + if ($cc -o tcio tcio.c && ./tcio) >/dev/null 2>&1; then
- + val="$define"
- + echo "TIOCNOTTY found in <$xxx>." >&4
- + echo "Using ioctl() call on /dev/tty to void tty association." >&4
- + else
- + val="$undef"
- + echo "Closing standard file descriptors should void tty association." >&4
- + fi
- + set d_voidtty
- + eval $setvar
- + $rm -f tcio tcio.? core
- +
- : preserve RCS keywords in files with variable substitution, grrr
- Header='$Header'
- Id='$Id'
- ***************
- *** 3036,3042 ****
-
- $package has manual pages available in source form.
- EOM
- ! case "$nroff" in
- nroff)
- echo "However, you don't have nroff, so they're probably useless to you."
- case "$mansrc" in
- --- 3325,3331 ----
-
- $package has manual pages available in source form.
- EOM
- ! case "$_nroff" in
- nroff)
- echo "However, you don't have nroff, so they're probably useless to you."
- case "$mansrc" in
- ***************
- *** 3228,3238 ****
- : determine the name of a reasonable mailer
- case "$mailer" in
- '')
- ! if $test -f "$sendmail"; then
- ! dflt="$sendmail"
- ! elif $test -f "$smail"; then
- ! dflt="$smail"
- ! elif $test -f "$rmail"; then
- dflt="$rmail"
- elif $test -f /bin/mail; then
- dflt=/bin/mail
- --- 3517,3527 ----
- : determine the name of a reasonable mailer
- case "$mailer" in
- '')
- ! if $test -f "$_sendmail"; then
- ! dflt="$_sendmail"
- ! elif $test -f "$_smail"; then
- ! dflt="$_smail"
- ! elif $test -f "$_rmail"; then
- dflt="$rmail"
- elif $test -f /bin/mail; then
- dflt=/bin/mail
- ***************
- *** 3580,3637 ****
- eval $setvar
- $rm -f prototype*
-
- - : get C preprocessor symbols handy
- - echo " "
- - echo $attrlist | $tr ' ' '\012' >Cppsym.know
- - $cat <<EOSS >Cppsym
- - $startsh
- - case "\$1" in
- - -l) list=true
- - shift
- - ;;
- - esac
- - unknown=''
- - case "\$list\$#" in
- - 1|2)
- - for sym do
- - if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
- - exit 0
- - elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
- - :
- - else
- - unknown="\$unknown \$sym"
- - fi
- - done
- - set X \$unknown
- - shift
- - ;;
- - esac
- - case \$# in
- - 0) exit 1;;
- - esac
- - echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
- - #ifdef \1\\
- - exit 0; _ _ _ _\1\\ \1\\
- - #endif\\
- - /' >Cppsym\$\$
- - echo "exit 1; _ _ _" >>Cppsym\$\$
- - $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
- - case "\$list" in
- - true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
- - *)
- - sh Cppsym2\$\$
- - status=\$?
- - ;;
- - esac
- - $rm -f Cppsym\$\$ Cppsym2\$\$
- - exit \$status
- - EOSS
- - chmod +x Cppsym
- - $eunicefix Cppsym
- - echo "Your C preprocessor defines the following symbols:"
- - Cppsym -l $attrlist >Cppsym.true
- - $cat Cppsym.true
- -
- : see how many register declarations we want to use
- case "$registers" in
- '')
- --- 3869,3874 ----
- ***************
- *** 4159,4164 ****
- --- 4396,4590 ----
- ;;
- esac
-
- + : find out how to find out full name
- + case "$d_berknames" in
- + "$define")
- + dflt=y;;
- + "$undef")
- + dflt=n;;
- + *)
- + if bsd; then
- + dflt=y
- + elif xenix; then
- + dflt=y
- + else
- + dflt=n
- + fi
- + ;;
- + esac
- + $cat <<'EOM'
- +
- + Does your /etc/passwd file keep full names in Berkeley/V7 format (name first
- + thing after ':' in GCOS field)? In that case, a typical entry in the password
- + file looks like this:
- +
- + guest:**paswword**:10:100:Mister Guest User:/usr/users:/bin/sh
- + ^^^^^^^^^^^^^^^^^
- + EOM
- + rp="Berkeley/V7 format for full name in /etc/password?"
- + . ./myread
- + case "$ans" in
- + y*) d_passnames="$define"
- + d_berknames="$define"
- + d_usgnames="$undef"
- + nametype=bsd
- + ;;
- + *)
- + case "$d_usgnames" in
- + "$define") dflt=y;;
- + "$undef") dflt=n;;
- + *)
- + if usg; then
- + dflt=y
- + else
- + dflt=n
- + fi
- + ;;
- + esac
- + $cat <<'EOM'
- +
- + Does your passwd file keep full names in USG format (name sandwiched between a
- + '-' and a '(')? In that case, a typical entry in the password file looks like
- + this:
- +
- + guest:**paswword**:10:100:000-Mister Guest User(000):/usr/users:/bin/sh
- + ^^^^^^^^^^^^^^^^^
- + EOM
- + rp="USG format for full name in /etc/passwd?"
- + . ./myread
- + case "$ans" in
- + n*) echo "Full name will be taken from ~/.fullname"
- + d_passnames="$undef"
- + d_berknames="$undef"
- + d_usgnames="$undef"
- + nametype=other
- + ;;
- + *)
- + d_passnames="$define"
- + d_berknames="$undef"
- + d_usgnames="$define"
- + nametype=usg
- + ;;
- + esac;;
- + esac
- +
- + : figure out their full name
- + case "$NAME" in
- + '') case "$nametype" in
- + other)
- + fn=`./filexp ~/.fullname`
- + xxx=usg
- + $test -f $fn && xxx=other
- + ;;
- + *)
- + xxx="$nametype"
- + ;;
- + esac
- +
- + case "$xxx" in
- + bsd)
- + cf_name=`$passcat | grep "^$cf_by:" | \
- + sed -e 's/^[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/\1/'`
- + ;;
- + usg)
- + cf_name=`$passcat | grep "^$cf_by:" | \
- + sed -e 's/^[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/\1/' \
- + -e 's/[^-]*-\(.*\)(.*)/\1/'`
- + ;;
- + *)
- + cf_name=`$cat $fn`
- + ;;
- + esac
- + ;;
- + *)
- + cf_name="$NAME"
- + ;;
- + esac
- + echo " "
- + echo "Pleased to meet you, $cf_name."
- +
- + $cat <<EOM
- +
- + I need to get your e-mail address in Internet format if possible, i.e.
- + something like user@host.domain. Please answer accurately since I have
- + no easy means to double check it. The default value provided below
- + is most probably close to the reality but may not be valid from outside
- + your organization...
- +
- + EOM
- + cont=x
- + while test "$cont"; do
- + case "$cf_email" in
- + '') dflt="$cf_by@$myhostname$mydomain";;
- + *) dflt="$cf_email";;
- + esac
- + rp='What is your e-mail address?'
- + . ./myread
- + cf_email="$ans"
- + case "$cf_email" in
- + *@*.*) cont='' ;;
- + *)
- + rp='Address does not look like an Internet one. Use it anyway?'
- + case "$fastread" in
- + yes) dflt=y ;;
- + *) dflt=n ;;
- + esac
- + . ./myread
- + case "$ans" in
- + y*) cont='' ;;
- + *) echo " " ;;
- + esac
- + ;;
- + esac
- + done
- +
- + : offer to join the mailing list
- + list_request='majordomo@foretune.co.jp'
- + list_sub="subscribe agent-users $cf_email"
- + list_unsub="unsubscribe agent-users $cf_email"
- + list_name="agent-users"
- + $cat <<EOM
- +
- + There is a mailing list for discussion about $package and related issues.
- + This is the preferred place to ask questions about the program and discuss
- + modifications and additions with the author and other users. If you are able
- + to send mail to the Internet, you are encouraged to subscribe. You need only
- + ever subscribe once, and you can unsubscribe automatically at any time in the
- + future. If you have already subscribed and you wish to unsubscribe now, you
- + may do so by answering "unsubscribe". Answer "subscribe" to subscribe to the
- + list.
- +
- + EOM
- + rp="Subscribe to or unsubscribe from the $list_name mailing list?"
- + dflt=neither
- + . ./myread
- + case "$ans" in
- + [sS]*) $cat <<EOM
- +
- + You will be sent a message from the list server to let you know when your
- + subscription has been successful and telling you how to submit articles and
- + how to unsubscribe again when necessary. You may also unsubscribe by running
- + this script again and asking it to do so for you.
- +
- + EOM
- + echo "Sending mail to subscribe you to the $list_name list..." >&4
- + $mailer $list_request <<EOM >/dev/null 2>&1
- + Precedence: junk
- + To: $list_request
- +
- + $list_sub
- + EOM
- + ;;
- + [uU]*) echo "Sending mail to unsubscribe you from the $list_name list..." >&4
- + $mailer $list_request <<EOM >/dev/null 2>&1
- + Precedence: junk
- + To: $list_request
- +
- + $list_unsub
- + EOM
- + ;;
- + esac
- +
- : end of configuration questions
- echo " "
- echo "End of configuration questions."
- ***************
- *** 4292,4297 ****
- --- 4718,4724 ----
- ldflags='$ldflags'
- lkflags='$lkflags'
- optimize='$optimize'
- + cf_email='$cf_email'
- cf_by='$cf_by'
- cf_time='$cf_time'
- contains='$contains'
- ***************
- *** 4310,4315 ****
- --- 4737,4746 ----
- d_open3='$d_open3'
- d_portable='$d_portable'
- d_rename='$d_rename'
- + d_setpgid='$d_setpgid'
- + d_bsdpgrp='$d_bsdpgrp'
- + d_setpgrp='$d_setpgrp'
- + d_setsid='$d_setsid'
- d_index='$d_index'
- d_strchr='$d_strchr'
- d_strerrm='$d_strerrm'
- ***************
- *** 4318,4323 ****
- --- 4749,4755 ----
- d_syserrlst='$d_syserrlst'
- d_time='$d_time'
- timetype='$timetype'
- + d_uwait3='$d_uwait3'
- d_uwait='$d_uwait'
- d_vfork='$d_vfork'
- d_voidsig='$d_voidsig'
- ***************
- *** 4328,4334 ****
- --- 4760,4773 ----
- i_string='$i_string'
- strings='$strings'
- i_sysfile='$i_sysfile'
- + d_voidtty='$d_voidtty'
- + i_bsdioctl='$i_bsdioctl'
- + i_sysioctl='$i_sysioctl'
- + i_syssockio='$i_syssockio'
- i_syswait='$i_syswait'
- + i_sgtty='$i_sgtty'
- + i_termio='$i_termio'
- + i_termios='$i_termios'
- i_systime='$i_systime'
- i_systimek='$i_systimek'
- i_time='$i_time'
- ***************
- *** 4363,4368 ****
- --- 4802,4811 ----
- phostname='$phostname'
- c='$c'
- n='$n'
- + d_berknames='$d_berknames'
- + d_passnames='$d_passnames'
- + d_usgnames='$d_usgnames'
- + nametype='$nametype'
- groupcat='$groupcat'
- hostcat='$hostcat'
- passcat='$passcat'
-
- Index: agent/man/mailagent.SH
- Prereq: 3.0.1.1
- *** agent/man/mailagent.SH.old Wed Jan 26 10:36:39 1994
- --- agent/man/mailagent.SH Wed Jan 26 10:36:40 1994
- ***************
- *** 20,26 ****
- .TH MAILAGENT $manext "Version $VERSION PL$PATCHLEVEL"
- ''' @(#) Manual page for mailagent's filter -- (c) ram February 1991
- '''
- ! ''' $Id: mailagent.SH,v 3.0.1.1 1993/12/15 09:03:44 ram Exp $
- '''
- ''' Copyright (c) 1990-1993, Raphael Manfredi
- '''
- --- 20,26 ----
- .TH MAILAGENT $manext "Version $VERSION PL$PATCHLEVEL"
- ''' @(#) Manual page for mailagent's filter -- (c) ram February 1991
- '''
- ! ''' $Id: mailagent.SH,v 3.0.1.2 1994/01/26 09:29:24 ram Exp $
- '''
- ''' Copyright (c) 1990-1993, Raphael Manfredi
- '''
- ***************
- *** 31,36 ****
- --- 31,41 ----
- ''' of the source tree for mailagent 3.0.
- '''
- ''' $Log: mailagent.SH,v $
- + ''' Revision 3.0.1.2 1994/01/26 09:29:24 ram
- + ''' patch5: documents new tag feature for UNIQUE and RECORD
- + ''' patch5: documents new -F option
- + ''' patch5: random typo fixes
- + '''
- ''' Revision 3.0.1.1 1993/12/15 09:03:44 ram
- ''' patch3: typo and minor fixes
- '''
- ***************
- *** 610,615 ****
- --- 615,627 ----
- was issued), extract all its messages into the queue and process them as if
- they were freshly arrived from the mail delivery subsystem.
- .TP
- + .B \-F
- + Force processing on already seen messages. Usually, \fImailagent\fR enters
- + the special \fI_SEEN_\fR mode when it detects an \fIX-Filter:\fR line issued
- + by itself, but this option will have it continue as usual (although vacation
- + messages are disabled). Use this option when post-processing mail already
- + filtered.
- + .TP
- .B \-h
- Print out a usage message on the standard error and exit.
- .TP
- ***************
- *** 1451,1457 ****
- mail will remain in the queue until another mail arrives.
- (Fails when mail cannot be queued)
- .TP
- ! RECORD [-acr] [\fImode\fR]
- Record message in the history and enters mode _SEEN_ if the message was
- already present there. If the message is recorded for the first time, processing
- continues normally. Otherwise a REJECT is performed. This behavior may be
- --- 1463,1469 ----
- mail will remain in the queue until another mail arrives.
- (Fails when mail cannot be queued)
- .TP
- ! RECORD [-acr] [\fImode\fR] [\fI(tag-list)\fR]
- Record message in the history and enters mode _SEEN_ if the message was
- already present there. If the message is recorded for the first time, processing
- continues normally. Otherwise a REJECT is performed. This behavior may be
- ***************
- *** 1458,1463 ****
- --- 1470,1479 ----
- somewhat modified by using some options. See UNIQUE for a complete description
- of the options and arguments. Naturally, when a \fImode\fR is specified, that
- overrides the default _SEEN_.
- + When a \fItag-list\fR (comma-separated list of names) is specified, the message
- + is only recorded and checked againsts all those tags, but only them. Not
- + specifying any tag list means any occurence, whether it is tagged or not.
- + See paragraph \fBUsing Tags in Record and Unique\fR for more information.
- (Returns a failure status if mail was already recorded)
- .TP
- REJECT [-tf] [\fImode\fR]
- ***************
- *** 1580,1586 ****
- lowercase. See also ASSIGN and SUBST.
- (Fails if error in \fItranslation\fR)
- .TP
- ! UNIQUE [-acr] [\fImode\fR]
- Record message in the history and tag message as saved if it was
- already present there. If the message is recorded for the first time, processing
- continues normally. Otherwise a REJECT is performed. If \fB\-r\fR was used,
- --- 1596,1602 ----
- lowercase. See also ASSIGN and SUBST.
- (Fails if error in \fItranslation\fR)
- .TP
- ! UNIQUE [-acr] [\fImode\fR] [\fI(tag-list)\fR]
- Record message in the history and tag message as saved if it was
- already present there. If the message is recorded for the first time, processing
- continues normally. Otherwise a REJECT is performed. If \fB\-r\fR was used,
- ***************
- *** 1592,1598 ****
- UNIQUE returns a failure status if the message was already recorded.
- If an optional \fImode\fR argument is given, then the automaton will enter that
- mode if the mail was previously in the database.
- ! See also RECORD. (Fails if mail was already recorded)
- .TP
- VACATION \fIon/off\fR
- Allow or disallow a vacation message. When vacation mode is turned on via the
- --- 1608,1616 ----
- UNIQUE returns a failure status if the message was already recorded.
- If an optional \fImode\fR argument is given, then the automaton will enter that
- mode if the mail was previously in the database.
- ! See also RECORD, and the paragraph entitled \fBUsing Tags in Record and
- ! Unique\fR for more information about the \fItag-list\fR.
- ! (Fails if mail was already recorded)
- .TP
- VACATION \fIon/off\fR
- Allow or disallow a vacation message. When vacation mode is turned on via the
- ***************
- *** 2112,2117 ****
- --- 2130,2185 ----
- \fIHash/m/e\fR (where \fIHash\fR is the name of your hashing directory, which
- is the \fIhash\fR parameter in the configuration file).
- '''
- + .SS "Using Tags in Record and Unique"
- + .PP
- + Both the RECORD and UNIQUE commands let you specify a comma-separated tag list
- + between '(' and ')'. For each tag present in the list, there is a separate
- + entry in the database associated with the message ID. When the message is
- + recorded for at least one of the tags, the command "fails". Not specifying
- + any tags means looking for any occurence of that message ID, whether it is
- + tagged or not.
- + .PP
- + This is very useful when receiving mail cross-posted to distinct mailing lists
- + and you want to save one instance of the message in each folder, but still
- + guard against duplicates. You may say:
- + .Ex
- + To Cc: unix-wizards {
- + UNIQUE (wizards); REJECT -f;
- + SAVE wizards;
- + REJECT;
- + };
- + To Cc: majordomo-users {
- + UNIQUE (majordomo); REJECT -f;
- + SAVE majordomo;
- + REJECT;
- + };
- + .Ef
- + and only one instance of the message will end up in each folder. When you
- + have folders with conflicting interests, you might use a tag list, instead
- + of a single tag. For instance, assuming you wish to keep a single copy for
- + messages cross-posted to both \fIdist-users\fR and \fIagent-users\fR, but
- + have a separate copy if also cross-posted to \fImajordomo-users\fR, then say:
- + .Ex
- + To Cc: majordomo-users {
- + UNIQUE (majordomo); REJECT -f;
- + SAVE majordomo;
- + REJECT;
- + };
- + To Cc: dist-users {
- + UNIQUE (dist, agent); REJECT -f;
- + SAVE dist-users;
- + REJECT;
- + };
- + To Cc: agent-users {
- + UNIQUE (dist, agent); REJECT -f;
- + SAVE dist-users;
- + REJECT;
- + };
- + .Ef
- + If you have some rule using UNIQUE without any
- + tags, it will match when at least one instance of the message has been
- + recorded, no matter what tag (if any at all) was used in the first place.
- + '''
- .SS "Specifying A Period"
- .PP
- The period parameter of the ONCE commands or the \fIvacperiod\fR parameter
- ***************
- *** 2663,2669 ****
- .TP
- .I &header'valid(line)
- Returns a boolean status, indicating if all the lines given so far to this
- ! function since the last &header'reset are part of a valid RFC822 header.
- The function understands the first From line which is part of UNIX mails.
- At any time, the variable \fI\$header'maybe\fR may be checked to see if
- so far we have found at least one essential mail header field.
- --- 2731,2737 ----
- .TP
- .I &header'valid(line)
- Returns a boolean status, indicating if all the lines given so far to this
- ! function since the last \fI&header'reset\fR are part of a valid RFC822 header.
- The function understands the first From line which is part of UNIX mails.
- At any time, the variable \fI\$header'maybe\fR may be checked to see if
- so far we have found at least one essential mail header field.
-
- Index: config_h.SH
- Prereq: 3.0
- *** config_h.SH.old Wed Jan 26 10:36:49 1994
- --- config_h.SH Wed Jan 26 10:36:49 1994
- ***************
- *** 25,31 ****
- * that running config.h.SH again will wipe out any changes you've made.
- * For a more permanent change edit config.sh and rerun config.h.SH.
- *
- ! * \$Id: config_h.SH,v 3.0 1993/11/29 13:50:28 ram Exp $
- */
-
- /* Configuration time: $cf_time
- --- 25,31 ----
- * that running config.h.SH again will wipe out any changes you've made.
- * For a more permanent change edit config.sh and rerun config.h.SH.
- *
- ! * \$Id: config_h.SH,v 3.0.1.1 1994/01/26 09:36:20 ram Exp $
- */
-
- /* Configuration time: $cf_time
- ***************
- *** 70,75 ****
- --- 70,99 ----
- */
- #$d_rename HAS_RENAME /**/
-
- + /* HAS_SETPGID:
- + * This symbol, if defined, indicates that the setpgid routine is
- + * available to set process group ID.
- + */
- + #$d_setpgid HAS_SETPGID /**/
- +
- + /* HAS_SETPGRP:
- + * This symbol, if defined, indicates that the setpgrp routine is
- + * available to set the current process group.
- + */
- + /* USE_BSDPGRP:
- + * This symbol, if defined, indicates that the BSD notion of process
- + * group is to be used. For instance, you have to say setpgrp(pid, pgrp)
- + * instead of the USG setpgrp().
- + */
- + #$d_setpgrp HAS_SETPGRP /**/
- + #$d_bsdpgrp USE_BSDPGRP /**/
- +
- + /* HAS_SETSID:
- + * This symbol, if defined, indicates that the setsid routine is
- + * available to set the process group ID.
- + */
- + #$d_setsid HAS_SETSID /**/
- +
- /* HAS_INDEX:
- * This symbol is defined to indicate that the index()/rindex()
- * functions are available for string searching.
- ***************
- *** 78,84 ****
-
- /* HAS_STRERROR:
- * This symbol, if defined, indicates that the strerror routine is
- ! * available to translate error numbers to strings.
- */
- /* HAS_SYS_ERRLIST:
- * This symbol, if defined, indicates that the sys_errlist array is
- --- 102,109 ----
-
- /* HAS_STRERROR:
- * This symbol, if defined, indicates that the strerror routine is
- ! * available to translate error numbers to strings. See the writeup
- ! * of strerror() in this file before you try to define your own.
- */
- /* HAS_SYS_ERRLIST:
- * This symbol, if defined, indicates that the sys_errlist array is
- ***************
- *** 145,150 ****
- --- 170,188 ----
- */
- #$i_sysfile I_SYS_FILE /**/
-
- + /* I_SYS_IOCTL:
- + * This symbol, if defined, indicates that <sys/ioctl.h> exists and should
- + * be included. Otherwise, include <sgtty.h> or <termio.h>.
- + */
- + /* USE_TIOCNOTTY:
- + * This symbol, if defined indicate to the C program that the ioctl()
- + * call with TIOCNOTTY should be used to void tty association.
- + * Otherwise (on USG probably), it is enough to close the standard file
- + * decriptors and do a setpgrp().
- + */
- + #$i_sysioctl I_SYS_IOCTL /**/
- + #$d_voidtty USE_TIOCNOTTY /**/
- +
- /* I_SYS_WAIT:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/wait.h>.
- ***************
- *** 198,242 ****
- * If defined, this macro indicates that the C compiler can handle
- * function prototypes.
- */
- - /* DOTS:
- - * This macro is used to specify the ... in function prototypes which
- - * have arbitrary additional arguments.
- - */
- - /* NXT_ARG:
- - * This macro is used to separate arguments in the declared argument list.
- - */
- - /* P_FUNC:
- - * This macro is used to declare "private" (static) functions.
- - * It takes three arguments: the function type and name, a parenthesized
- - * traditional (comma separated) argument list, and the declared argument
- - * list (in which arguments are separated with NXT_ARG, and additional
- - * arbitrary arguments are specified with DOTS). For example:
- - *
- - * P_FUNC(int foo, (bar, baz), int bar NXT_ARG char *baz[])
- - */
- - /* P_FUNC_VOID:
- - * This macro is used to declare "private" (static) functions that have
- - * no arguments. The macro takes one argument: the function type and name.
- - * For example:
- - *
- - * P_FUNC_VOID(int subr)
- - */
- - /* V_FUNC:
- - * This macro is used to declare "public" (non-static) functions.
- - * It takes three arguments: the function type and name, a parenthesized
- - * traditional (comma separated) argument list, and the declared argument
- - * list (in which arguments are separated with NXT_ARG, and additional
- - * arbitrary arguments are specified with DOTS). For example:
- - *
- - * V_FUNC(int main, (argc, argv), int argc NXT_ARG char *argv[])
- - */
- - /* V_FUNC_VOID:
- - * This macro is used to declare "public" (non-static) functions that have
- - * no arguments. The macro takes one argument: the function type and name.
- - * For example:
- - *
- - * V_FUNC_VOID(int fork)
- - */
- /* _:
- * This macro is used to declare function parameters for folks who want
- * to make declarations with prototypes using a different style than
- --- 236,241 ----
- ***************
- *** 246,265 ****
- */
- #$prototype CAN_PROTOTYPE /**/
- #ifdef CAN_PROTOTYPE
- - #define NXT_ARG ,
- - #define DOTS , ...
- - #define V_FUNC(name, arglist, args)name(args)
- - #define P_FUNC(name, arglist, args)static name(args)
- - #define V_FUNC_VOID(name)name(void)
- - #define P_FUNC_VOID(name)static name(void)
- #define _(args) args
- #else
- - #define NXT_ARG ;
- - #define DOTS
- - #define V_FUNC(name, arglist, args)name arglist args;
- - #define P_FUNC(name, arglist, args)static name arglist args;
- - #define V_FUNC_VOID(name)name()
- - #define P_FUNC_VOID(name)static name()
- #define _(args) ()
- #endif
-
- --- 245,252 ----
-
- Index: agent/filter/io.c
- Prereq: 3.0
- *** agent/filter/io.c.old Wed Jan 26 10:36:35 1994
- --- agent/filter/io.c Wed Jan 26 10:36:35 1994
- ***************
- *** 11,17 ****
- */
-
- /*
- ! * $Id: io.c,v 3.0 1993/11/29 13:48:10 ram Exp $
- *
- * Copyright (c) 1990-1993, Raphael Manfredi
- *
- --- 11,17 ----
- */
-
- /*
- ! * $Id: io.c,v 3.0.1.1 1994/01/26 09:27:13 ram Exp $
- *
- * Copyright (c) 1990-1993, Raphael Manfredi
- *
- ***************
- *** 22,27 ****
- --- 22,31 ----
- * of the source tree for mailagent 3.0.
- *
- * $Log: io.c,v $
- + * Revision 3.0.1.1 1994/01/26 09:27:13 ram
- + * patch5: now only try to include <sys/fcntl.h> when hope is lost
- + * patch5: filter will now put itself in daemon state while waiting
- + *
- * Revision 3.0 1993/11/29 13:48:10 ram
- * Baseline for mailagent 3.0 netwide release.
- *
- ***************
- *** 46,63 ****
-
- #ifdef I_FCNTL
- #include <fcntl.h>
- - #else
- - #include <sys/fcntl.h>
- #endif
- #ifdef I_SYS_FILE
- #include <sys/file.h>
- #endif
-
- #ifdef I_STRING
- #include <string.h>
- #else
- #include <strings.h>
- #endif
- #include "confmagic.h"
-
- #define BUFSIZE 1024 /* Amount of bytes read in a single call */
- --- 50,76 ----
-
- #ifdef I_FCNTL
- #include <fcntl.h>
- #endif
- #ifdef I_SYS_FILE
- #include <sys/file.h>
- #endif
-
- + #ifndef I_FCNTL
- + #ifndef I_SYS_FILE
- + #include <sys/fcntl.h> /* Try this one in last resort */
- + #endif
- + #endif
- +
- #ifdef I_STRING
- #include <string.h>
- #else
- #include <strings.h>
- #endif
- +
- + #ifdef I_SYS_IOCTL
- + #include <sys/ioctl.h>
- + #endif
- +
- #include "confmagic.h"
-
- #define BUFSIZE 1024 /* Amount of bytes read in a single call */
- ***************
- *** 73,78 ****
- --- 86,92 ----
- private void queue_mail(); /* Queue mail for delayed processing */
- private char *write_file(); /* Write mail on disk */
- private char *save_file(); /* Emergency saving into a file */
- + private void goto_daemon(); /* Disassociate process from tty */
-
- private char *mail = (char *) 0; /* Where mail is stored */
- private int len; /* Mail length in bytes */
- ***************
- *** 302,307 ****
- --- 316,323 ----
- exit(EX_OK); /* Exiting will also release sendmail process */
- } else if (pid != 0)
- exit(EX_OK); /* Release waiting sendmail */
- + else
- + goto_daemon(); /* Remaining child is to disassociate from tty */
- }
-
- /* Now hopefully we detached ourselves from sendmail, which thinks the mail
- ***************
- *** 569,574 ****
- --- 585,629 ----
- return (char *) 0;
- }
-
- + private void goto_daemon()
- + {
- + /* Make sure filter process goes into daemon state by releasing its
- + * control terminal and becoming the leader of a new process group
- + * or session.
- + *
- + * Harald Koch <chk@enfm.utcc.utoronto.ca> reported that this was
- + * needed when filter is invoked by zmailer's transport process.
- + * Otherwise the father waiting for his children does not get to see
- + * the EOF on the pipe, hanging forever.
- + */
- +
- + int fd;
- +
- + #ifdef USE_TIOCNOTTY
- + /*
- + * Errors from this open are discarded, since it is quite possible
- + * filter be launched without a controling tty, for instance when
- + * called via a daemon process like sendmail... :-)
- + */
- + if ((fd = open("/dev/tty", 2)) >= 0) {
- + if (-1 == ioctl(fd, TIOCNOTTY, (char *) 0)) {
- + add_log(1, "SYSERR ioctl: %m (%e)");
- + add_log(6, "WARNING could not release tty control");
- + }
- + (void) close(fd);
- + }
- + #endif
- +
- + (void) close(0);
- + (void) close(1);
- + (void) close(2);
- +
- + if (-1 == setsid()) {
- + add_log(1, "SYSERR setsid: %m (%e)");
- + add_log(6, "WARNING did not become session leader");
- + }
- + }
- +
- #ifndef HAS_RENAME
- public int rename(from, to)
- char *from; /* Original name */
- ***************
- *** 581,586 ****
- --- 636,677 ----
- return -1;
-
- return 0;
- + }
- + #endif
- +
- + #ifndef HAS_SETSID
- + public int setsid()
- + {
- + /* Set the process group ID and create a new session for the process.
- + * This is a pale imitation of the setsid() system call. Actually, we
- + * go into a lot more trouble here than is really needed...
- + */
- +
- + int error = 0;
- +
- + #ifdef HAS_SETPGID
- + /*
- + * setpgid() supersedes setpgrp() in OSF/1.
- + */
- + error = setpgid(0 ,getpid());
- + #else
- + #ifdef HAS_SETPGRP
- + /*
- + * Good old way to get a process group leader.
- + */
- + #ifdef USE_BSDPGRP
- + error = setpgrp(0 ,getpid()); /* bsd way */
- + #else
- + error = setpgrp(); /* usg way */
- + #endif
- + #endif
- + #endif
- +
- + /*
- + * When none of the above is defined, do nothing.
- + */
- +
- + return error;
- }
- #endif
-
-
- Index: agent/pl/filter.pl
- Prereq: 3.0
- *** agent/pl/filter.pl.old Wed Jan 26 10:36:44 1994
- --- agent/pl/filter.pl Wed Jan 26 10:36:44 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: filter.pl,v 3.0 1993/11/29 13:48:46 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: filter.pl,v 3.0.1.1 1994/01/26 09:31:43 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: filter.pl,v $
- + ;# Revision 3.0.1.1 1994/01/26 09:31:43 ram
- + ;# patch5: added tags to UNIQUE and RECORD commands
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:46 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 203,216 ****
- # Run the RECORD command
- sub run_record {
- local($option, $mode) = $cmd =~ m|^\w+\s+(-\w)?\s*(\w+)?|;
- local($failed) = 0;
- ! if (&history_record) { # Message already seen
- $wmode = '_SEEN_'; # Enter special mode ($wmode from analyze_mail)
- &add_log("NOTICE entering seen mode") if $loglvl > 5;
- &alter_execution($option, $mode);
- $failed = 1; # Make sure it "fails"
- }
- ! &add_log("RECORDED [$mfile]") if $loglvl > 4;
- $failed;
- }
-
- --- 206,221 ----
- # Run the RECORD command
- sub run_record {
- local($option, $mode) = $cmd =~ m|^\w+\s+(-\w)?\s*(\w+)?|;
- + local($tags) = $cmd =~ m|\(([^()]*)\)|;
- local($failed) = 0;
- ! if (&history_tag($tags)) { # Message already seen
- $wmode = '_SEEN_'; # Enter special mode ($wmode from analyze_mail)
- &add_log("NOTICE entering seen mode") if $loglvl > 5;
- &alter_execution($option, $mode);
- $failed = 1; # Make sure it "fails"
- }
- ! local($tagmsg) = $tags ne '' ? " ($tags)" : '';
- ! &add_log("RECORDED [$mfile]" . $tagmsg) if $loglvl > 4;
- $failed;
- }
-
- ***************
- *** 217,230 ****
- # Run the UNIQUE command
- sub run_unique {
- local($option, $mode) = $cmd =~ m|^\w+\s+(-\w)?\s*(\w+)?|;
- local($failed) = 0;
- ! if (&history_record) { # Message already seen
- &add_log("NOTICE message tagged as saved") if $loglvl > 5;
- $ever_saved = 1; # In effect, runs a DELETE
- &alter_execution($option, $mode);
- $failed = 1; # Make sure it "fails"
- }
- ! &add_log("UNIQUE [$mfile]") if $loglvl > 4;
- $failed;
- }
-
- --- 222,237 ----
- # Run the UNIQUE command
- sub run_unique {
- local($option, $mode) = $cmd =~ m|^\w+\s+(-\w)?\s*(\w+)?|;
- + local($tags) = $cmd =~ m|\(([^()]*)\)|;
- local($failed) = 0;
- ! if (&history_tag($tags)) { # Message already seen
- &add_log("NOTICE message tagged as saved") if $loglvl > 5;
- $ever_saved = 1; # In effect, runs a DELETE
- &alter_execution($option, $mode);
- $failed = 1; # Make sure it "fails"
- }
- ! local($tagmsg) = $tags ne '' ? " ($tags)" : '';
- ! &add_log("UNIQUE [$mfile]" . $tagmsg) if $loglvl > 4;
- $failed;
- }
-
- ***************
- *** 630,635 ****
- --- 637,643 ----
- local($log_message); # Log message to be issued
- unless ($failed) {
- local($file) = $folder; # Work on a copy to detect leading dir
- + $folddir =~ s/(\W)/\\$1/g; # Escape possible meta-characters
- $file =~ s|^$folddir/||; # Preceded by folder directory?
- if ($file =~ s/^\+//) {
- $log_message = "MH folder $file";
-
- *** End of Patch 5 ***
-
- exit 0 # Just in case...
-