/[pkg-mixmaster]/trunk/Mix/Install
ViewVC logotype

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


Revision 159 - (hide annotations) (download)
Wed Aug 21 16:03:12 2002 UTC (10 years, 9 months ago) by weaselp
File size: 21009 byte(s)
Secret plan to get rid of IDEA stage (1):
 The Install script detects - in a reliable fashion - whether idea support
 is available. It only defines USE_IDEA if this is the case. On operating
 systems that lack the patented IDEA algorithm (OpenBSD and Debian for
 instance) a warning is printed but building and installation is not
 halted.
1 rabbi 1 #!/bin/sh
2     # Mixmaster version 3 -- (C) 1999 Anonymizer Inc.
3    
4     # Mixmaster may be redistributed and modified under certain conditions.
5     # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
6     # ANY KIND, either express or implied. See the file COPYRIGHT for
7     # details.
8    
9 weaselp 159 # $Id: Install,v 1.10 2002/08/21 16:00:31 weaselp Exp $
10 rabbi 1
11     #whereis program default-path
12     whereis()
13     {
14     #echo "Looking for $1..."
15     found=""
16     for i in $* `which $1 2>&1`
17     do
18     if [ -f "$i" -a -x "$i" ]
19     then
20     found=$i
21     fi
22     done
23     if [ "$found" = "" ]
24     then
25     found=$2
26     # echo "$1 not found. Using $found."
27     # else
28     # echo "$1 is at $found."
29     fi
30     }
31    
32     if echo -n | grep n >/dev/null
33     then
34     echo1=""
35     echo2="\c"
36     else
37     echo1="-n"
38     echo2=""
39     fi
40    
41     # readln text default
42     readln()
43     {
44     echo $echo1 "$1 [$2] $echo2"
45     read ans
46     if [ -z "$ans" ]
47     then
48     ans="$2"
49     fi
50     }
51    
52     # findlib libxxx.a -- find and configure libraries
53     # Input:
54     # $1 library name
55     # $CONFIG library configure options
56     # $INCDIR possible include directories
57     # $SRCDIR possible library source directories
58     # $LIBDIR possible library binary directories
59     #
60     # Output:
61     # $found library directory
62     # $lib library name
63     # $INCDIR include directory if required, empty otherwise
64     # $LDFLAG linker options
65     # $LIB path to library file
66     # $MAKELIB Makefile entry to compile library
67     findlib()
68     {
69     lib=$1
70     libso=`echo $lib | sed 's/\.a$/.so/'`
71     echo "Looking for $lib..."
72    
73     found=
74     source=
75     type=
76     LIB=
77     LDFLAG=
78     MAKELIB=
79    
80     for i in /usr/local/lib /usr/lib /lib
81     do
82     if [ -r $i/$lib -o -r $i/$libso ]
83     then
84     found=$i
85     type=system
86     fi
87     done
88    
89     for i in $LIBDIR
90     do
91     if [ -r $i/$lib -o -r $i/$libso ]
92     then
93     found=$i
94     type=installed
95     fi
96     done
97    
98     for i in $SRCDIR
99     do
100     if [ -r $i/$lib -o -r $i/lib/$lib ]
101     then
102     found=$i
103     type=binary
104     fi
105     done
106    
107     if [ -r "$found/$libso" ]
108     then
109     echo "Found at $found/$libso."
110     elif [ -r "$found/$lib" ]
111     then
112     echo "Found at $found/$lib."
113     elif [ -r "$found/lib/$lib" ]
114     then
115     echo "Found at $found/lib/$lib."
116     fi
117    
118     for i in $SRCDIR
119     do
120     if [ -d $i -a ! "$type" = binary ]
121     then
122     source=$i
123     fi
124     done
125    
126     if [ "$source" != "" ]
127     then
128     echo "Found source directory $source."
129     if [ "$found" = "" ]
130     then
131     ans=y
132     else
133     echo "Use the source if the pre-installed library causes compilation problems."
134     readln "Use source?" n
135     fi
136     if [ "$ans" = "y" ]
137     then
138     found=$source
139     type=source
140     fi
141     fi
142    
143     if [ "$found" = "" ]
144     then
145     echo "Not found."
146     fi
147    
148     if [ -r $found/lib/$lib ]
149     then
150     LIB=$found/lib/$lib
151     else
152     LIB=$found/$lib
153     fi
154     if [ "$type" = system ]
155     then
156     LIB=
157     LDFLAG=-l`echo $lib | sed 's/^lib//;s/\.a$//'`
158     fi
159    
160     incdir=$INCDIR
161     INCDIR=
162     for i in $incdir
163     do
164     if [ -d $i ]
165     then
166     INCDIR=$i
167     fi
168     done
169    
170     if [ "$type" = source -o "$type" = binary ]
171     then
172     if [ ! -r $found/lib/$lib ]
173     then
174     MAKELIB="$found/$lib:
175     cd $found; make $lib"
176     fi
177     if [ -d $found/include ]
178     then
179     INCDIR=$found/include
180     else
181     INCDIR=$found
182     fi
183     fi
184    
185     if [ "$type" = source ]
186     then
187     dir=`pwd`
188     if [ "$dir" = "" ]
189     then
190     dir=$PWD
191     fi
192    
193     cd $found
194     if [ -x configure ]
195     then
196     echo "Configuring..."
197     ./configure $CONFIG
198     fi
199     if [ "$lib" = "libcrypto.a" ]
200     then
201     if [ -f config ]
202     then
203     sh config
204     elif [ -x Configure ]
205     then
206     ./Configure 2>tmp.$$
207     cat tmp.$$
208     readln "Your system?" `cat tmp.$$ | tr ' ' '\n' | grep -i \`uname\` | tail -1`
209     rm -f tmp.$$
210     echo "Configuring..."
211     ./Configure $ans
212     fi
213     fi
214     cd $dir
215     fi
216     }
217    
218     ##########################################################################
219     umask 077
220    
221     if [ `whoami` = root ]
222     then
223     echo "Please create a new user, e.g, \`mix', and install Mixmaster under that
224     user id. Installing Mixmaster as root is not recommended."
225     readln "Continue anyway?" n
226     if [ "$ans" = n ]
227     then
228     exit 1
229     fi
230     fi
231    
232     MIXDIR=$PWD
233     if [ "$MIXDIR" = "" ]
234     then
235     MIXDIR=`pwd`
236     fi
237     MIXCFG=$MIXDIR/conf
238     MIXSRC=$MIXDIR/Src
239     MIXDEST0=${MIXPATH:-$HOME/Mix}
240    
241     system=`uname`
242     if [ "$system" = "MS-DOS" ]
243     then
244     system=msdos
245     fi
246    
247     if [ "$HOSTNAME" = "" ]
248     then
249     HOSTNAME=`hostname`
250     fi
251     if [ "$HOSTNAME" = "" ]
252     then
253     HOSTNAME=msdos
254     system=msdos
255     fi
256    
257     if [ "$system" = msdos ]
258     then
259     MIXDEST0=${MIXPATH:-C:/Mix}
260     fi
261    
262     if [ -f $MIXSRC/Makefile ]
263     then
264     if grep "#Makefile generated.*$HOSTNAME" $MIXSRC/Makefile
265     then
266     echo "Found a Makefile."
267     else
268     readln "Remove old Makefile?" y
269     if [ "$ans" = y ]
270     then
271     rm -f $MIXSRC/Makefile
272     fi
273     fi
274     fi
275    
276     if [ -f $MIXSRC/Makefile ]
277     then
278     MIXDEST=`grep "DSPOOL=" $MIXSRC/Makefile | sed 's/.*DSPOOL=..//;s/\".*//'`
279     if [ "$MIXDEST" = "" ]
280     then
281     MIXDEST="$MIXDEST0"
282     fi
283     fi
284    
285     if [ "$MIXDEST" = "" ]
286     then
287     readln "Mixmaster directory?" $MIXDEST0
288     MIXDEST=$ans
289     else
290     echo "Mixmaster directory: $MIXDEST"
291     fi
292    
293     if [ ! -d $MIXDEST ]
294     then
295     echo "Creating directory $MIXDEST"
296     mkdir $MIXDEST
297     fi
298    
299     if [ ! -d $MIXDEST ]
300     then
301     echo "Cannot not create $MIXDEST"
302     exit 1
303     fi
304    
305     if [ -f $MIXDEST/mix.cfg ]
306     then
307     if [ -f $MIXDEST/secring.mix ]
308     then
309     remailer=y
310 weaselp 157 if grep PASSPHRASE $MIXDEST/mix.cfg >/dev/null
311     then
312     PASSINCONFIG=1
313     fi
314 rabbi 1 else
315     readln "Do you want to set up a remailer?" n
316     remailer=$ans
317     fi
318     elif [ -f $MIXDEST/mixmaster.conf ]
319     then
320     echo "Upgrading from Mixmaster 2.0.*"
321     remailer=n
322     else
323     readln "Do you want to set up a remailer?" y
324     remailer=$ans
325     fi
326    
327 weaselp 157
328     ans=""
329     if [ "$remailer" = "y" ]
330     then
331     ans="n"
332     if [ "$PASSINCONFIG" != 1 ]
333     then
334     echo "You can eiter compile your secret pass phrase into the binary
335     or you can set it in your config file. Note that the former does not
336     really increase security as the passphrase can still be found out
337     by running something like »strings mix«."
338     readln "Do you want to compile the passphrase into the binary?" y
339     fi
340    
341     rm -f "$MIXSRC/mix.o" # make sure our new passphrase takes effect
342     if [ "$ans" = "y" ]
343     then
344     ans=""
345     echo "Please enter a pass phrase for your remailer (must be the same
346     whenever you re-compile Mixmaster)."
347     read ans
348    
349     if [ "$ans" != "" ]
350     then
351     PASS="PASS=$ans"
352     else
353     echo "WARNING: not setting a passphrase"
354     fi
355     else
356     if [ "$PASSINCONFIG" != 1 ]
357     then
358     ans=""
359     echo "Please enter a pass phrase for your remailer (it will be
360     stored in mix.cfg in clear)."
361     read ans
362    
363     if [ "$ans" == "" ]
364     then
365     echo "WARNING: setting empty passphrase"
366     fi
367     PASSPHRASE="PASSPHRASE $ans"
368     fi
369     fi
370     fi
371    
372    
373 rabbi 1 cd $MIXSRC
374     if [ ! -f Makefile ]
375     then
376     LIBS=
377     INC=
378     DEF=
379     LDFLAGS=
380    
381 weaselp 157 if [ ! -z "$PASS" ]
382     then
383     DEF="$DEF -DCOMPILEDPASS='\"\$(PASS)\"'"
384     fi
385    
386 rabbi 1 if [ "$system" = msdos ]
387     then
388     readln "Use WIN32 GUI?" y
389     if [ "$ans" = y ]
390     then
391     system=win32
392     LDFLAGS=-lwsock32
393     fi
394     fi
395     if [ "$system" = SunOS ]
396     then
397     LDFLAGS="-lsocket -lnsl"
398     fi
399    
400     LIBDIR=
401     INCDIR=
402     SRCDIR=zlib*
403     findlib libz.a
404     if [ "$found" = "" ]
405     then
406     readln "Continue anyway?" n
407     if [ "$ans" = "n" ]
408     then
409 rabbi 100 echo "Please install zlib 1.1.4 or greater now."
410 rabbi 1 exit 1
411     fi
412     else
413     ZLIB="$MAKELIB"
414     DEF="$DEF -DUSE_ZLIB"
415     LIBS="$LIBS $LIB"
416     LDFLAGS="$LDFLAGS $LDFLAG"
417     if [ "$INCDIR" != "" ]
418     then
419     INC="$INC -I$INCDIR"
420     fi
421     fi
422    
423     LIBDIR=
424     INCDIR=
425     SRCDIR=pcre*
426     findlib libpcre.a
427     if [ "$found" != "" ]
428     then
429     PCRE="$MAKELIB"
430     DEF="$DEF -DUSE_PCRE"
431     LIBS="$LIBS $LIB"
432     LDFLAGS="$LDFLAGS $LDFLAG"
433     if [ "$INCDIR" != "" ]
434     then
435     INC="$INC -I$INCDIR"
436     fi
437     fi
438    
439 rabbi 125 opensslinfo="Please get OpenSSL 0.9.6f or greater from http://www.openssl.org/"
440     opensslwarning="WARNING: This version of OpenSSL contains known vulnerabilities. Please upgrade to OpenSSL 0.9.6f or greater!"
441 rabbi 1 LIBDIR=/usr/local/ssl/lib
442     INCDIR="/usr/include /usr/include/ssl /usr/lib/ssl/include /usr/local/ssl/include"
443     SRCDIR="openssl*"
444    
445     if [ "$system" = win32 ]
446     then
447     findlib libeay32.a
448     else
449     findlib libcrypto.a
450     fi
451     if [ "$found" = "" ]
452     then
453     echo $opensslinfo
454     exit 1
455     fi
456    
457     LIBS="$LIBS $LIB"
458     LDFLAGS="$LDFLAGS $LDFLAG"
459     if [ "$MAKELIB" != "" ]
460     then
461     OPENSSL="$found/$lib:
462     cd $found/crypto; make"
463     fi
464     if [ -d "$INCDIR/openssl" ]
465     then
466     INC="$INC -I$INCDIR"
467     else
468     # detect old SSLeay versions
469     if [ -f "$INCDIR/crypto.h" ]
470     then
471     version=800
472     if grep OPENSSL "$INCDIR/crypto.h" > /dev/null
473     then
474     version=920
475     fi
476     fi
477     fi
478    
479     # Find the OpenSSL version header
480 rabbi 93 if [ -f $INCDIR/openssl/opensslv.h ]
481 rabbi 1 then
482 rabbi 93 version=`grep 'SSL.*_VERSION_NUMBER.*0x' $INCDIR/openssl/opensslv.h | sed 's/.*0x0*//;s/[ ].*//;s/L$//'`
483     elif [ -f $INCDIR/opensslv.h ]
484     then
485 rabbi 8 version=`grep 'SSL.*_VERSION_NUMBER.*0x' $INCDIR/opensslv.h | sed 's/.*0x0*//;s/[ ].*//;s/L$//'`
486 rabbi 1 fi
487     if [ "$version" = "" ]
488     then
489     echo "Warning: Can't find OpenSSL version number!"
490     readln "Continue anyway?" y
491     if [ "$ans" = "n" ]
492     then
493     echo $opensslinfo
494     exit 1
495     fi
496 rabbi 93 elif [ "16#$version" = "16#90581f" ]
497 rabbi 1 then
498 rabbi 100 echo "Compiling with OpenSSL 0.9.5a."
499 rabbi 125 echo $opensslwarning
500 rabbi 100 elif [ "16#$version" = "16#90601f" ]
501     then
502 rabbi 93 echo "Compiling with OpenSSL 0.9.6a."
503 rabbi 125 echo $opensslwarning
504 rabbi 93 elif [ "16#$version" = "16#90602f" ]
505     then
506     echo "Compiling with OpenSSL 0.9.6b."
507 rabbi 125 echo $opensslwarning
508 rabbi 93 elif [ "16#$version" = "16#90603f" ]
509     then
510     echo "Compiling with OpenSSL 0.9.6c."
511 rabbi 125 echo $opensslwarning
512 rabbi 93 elif [ "16#$version" = "16#90604f" ]
513     then
514     echo "Compiling with OpenSSL 0.9.6d."
515 rabbi 125 echo $opensslwarning
516     elif [ "16#$version" = "16#90605f" ]
517     then
518     echo "Compiling with OpenSSL 0.9.6e."
519     echo $opensslwarning
520     elif [ "16#$version" = "16#90606f" ]
521     then
522     echo "Compiling with OpenSSL 0.9.6f."
523     elif [ "16#$version" = "16#90607f" ]
524     then
525     echo "Compiling with OpenSSL 0.9.6g."
526 rabbi 93 elif [ "$version" -lt "920" ]
527     then
528 rabbi 8 echo "This version: ${version} of SSLeay is not supported."
529 rabbi 1 echo $opensslinfo
530     exit 1
531 rabbi 93 elif [ "$version" -lt "903100" ]
532 rabbi 1 then
533 rabbi 8 echo "This version: ${version} of OpenSSL is not supported."
534 rabbi 1 echo $opensslinfo
535     exit 1
536 rabbi 93 elif [ "$version" -gt "906000" ]
537 rabbi 1 then
538 rabbi 8 echo "Warning: This version: ${version} of OpenSSL is untested."
539 rabbi 1 readln "Continue anyway?" y
540     if [ "$ans" = "n" ]
541     then
542     echo $opensslinfo
543     exit 1
544     fi
545     fi
546    
547     LIBDIR=
548     INCDIR=/usr/include/ncurses
549     SRCDIR=ncurses*
550     CONFIG=--enable-termcap
551     if [ "$TERMINFO" != "" ]
552     then
553     CONFIG="--datadir=$TERMINFO"
554     fi
555     if [ -d /usr/share/terminfo ]
556     then
557     CONFIG=
558     fi
559     if [ -d /usr/lib/terminfo ]
560     then
561     CONFIG=--datadir=/usr/lib/terminfo
562     fi
563    
564     if [ `uname` = OpenBSD ]
565     then
566     findlib libcurses.a
567     else
568     findlib libncurses.a
569     fi
570     if [ "$found" = "" ]
571     then
572     if [ "$system" != win32 ]
573     then
574     readln "Do you want to use Mixmaster's menu-based user interface?" y
575     if [ "$ans" = "y" ]
576     then
577     echo "Please install ncurses now. It is available from
578     http://www.clark.net/pub/dickey/ncurses/ncurses.tar.gz"
579     exit 1
580     fi
581     fi
582     else
583     DEF="$DEF -DUSE_NCURSES"
584     if [ "$type" = system -o "$type" = installed ]
585     then
586     LIBS="$LIBS $LIB"
587     LDFLAGS="$LDFLAGS $LDFLAG"
588     else
589     LIBS="$LIBS $found/lib/$lib"
590     NCURSES="$found/lib/$lib:
591     cd $found/ncurses; make ../lib/$lib"
592     fi
593     if [ "$INCDIR" != "" ]
594     then
595     INC="$INC -I$INCDIR"
596     elif [ -f "/usr/include/ncurses.h" ]
597     then
598     DEF="$DEF -DHAVE_NCURSES_H"
599     fi
600     fi
601    
602 weaselp 159 if [ "$system" = OpenBSD ]
603     then
604     LIBDIR=
605     INCDIR=
606     SRCDIR=idea*
607     findlib libidea.a
608     if [ "$found" = "" ]
609     then
610     echo "WARNING: Building without IDEA. This means (among other things) that
611     Mixmaster will not create an RSA OpenPGP key (to cut down mail loss)"
612     else
613     DEF="$DEF -DUSE_IDEA"
614     IDEALIB="$MAKELIB"
615     LIBS="$LIBS $LIB"
616     LDFLAGS="$LDFLAGS $LDFLAG"
617     if [ "$INCDIR" != "" ]
618     then
619     INC="$INC -I$INCDIR"
620     fi
621     fi
622     elif [ "$system" = msdos -o "$system" = win32 ]
623     then
624     DEF="$DEF -DUSE_IDEA"
625     else
626     cat <<END >tmptst.c
627     #include <openssl/idea.h>
628     int main() {
629     exit(0);
630     }
631     END
632     if gcc tmptst.c -o /dev/null $LIBS $LDFLAGS
633     then
634     DEF="$DEF -DUSE_IDEA"
635     else
636     echo "WARNING: Building without IDEA. This means (among other things) that
637     Mixmaster will not create an RSA OpenPGP key (to cut down mail loss)"
638     fi
639     rm -f tmptst.c
640     fi
641    
642    
643 rabbi 1 # if [ "$MIXDEST" = "$HOME/Mix" ]
644     # then
645     # SPOOL=
646     # else
647     SPOOL=-DSPOOL=\'\"$MIXDEST\"\'
648     # fi
649    
650     echo "Generating Makefile."
651     echo "#Makefile generated on $HOSTNAME `date`" >Makefile
652     sed -e "s#%MIXDIR#$SPOOL#" \
653     -e "s#%LIBS#$LIBS#" \
654     -e "s#%LDFLAGS#$LDFLAGS#" \
655     -e "s#%INC#$INC#" \
656     -e "s#%DEF#$DEF#" < Makefile.in >> Makefile
657     echo "$ZLIB" >>Makefile
658     echo "$PCRE" >>Makefile
659 rabbi 8 echo "$IDEALIB" >>Makefile
660 rabbi 1 echo "$NCURSES" >>Makefile
661     echo "$OPENSSL" >>Makefile
662     fi
663    
664    
665    
666 weaselp 157
667    
668 rabbi 1 echo "Compiling. Please wait."
669     whereis gmake make
670     make=$found
671    
672     if [ "$system" = win32 ]
673     then
674     (cd zlib*; make libz.a)
675     (cd pcre*; make libpcre.a)
676     if [ "$PASS" != "" ]
677     then
678     $make "$PASS" dllmix
679     else
680     $make dllmix
681     fi
682     else
683     if [ "$PASS" != "" ]
684     then
685     $make "$PASS"
686     else
687     $make
688     fi
689     fi
690    
691     if [ -x mix ]
692     then
693     echo
694     else
695     echo "Error: The compilation failed. Please consult the documentation (section
696     \`Installation problems')."
697     readln "Remove the old Makefile?" y
698     if [ "$ans" = y ]
699     then
700     rm -f Makefile
701     fi
702     exit 1
703     fi
704    
705     if [ -f $MIXDEST/mixmaster.conf -a ! -f $MIXDEST/mix.cfg ]
706     then
707     export MIXDEST
708     export MIXDIR
709     export MIXSRC
710     ${MIXDIR}/upgrade
711     exit 0
712     fi
713    
714     if [ -f mix.exe ]
715     then
716     cp mix.exe $MIXDEST
717     else
718     cp mix $MIXDEST
719     fi
720    
721     cd $MIXCFG
722     for i in mlist.txt pubring.mix rlist.txt pubring.asc type2.list
723     do
724     if [ ! -f $MIXDEST/$i ]
725     then
726     cp $i $MIXDEST
727     fi
728     done
729    
730     if [ "$remailer" = "y" ]
731     then
732     cd $MIXCFG
733     for i in adminkey.txt dest.alw
734     do
735     if [ ! -f $MIXDEST/$i ]
736     then
737     cp $i $MIXDEST
738     fi
739     done
740     fi
741    
742     if [ "$remailer" = "n" ]
743     then
744     if [ ! -f $MIXDEST/mix.cfg ]
745     then
746     whereis sendmail /usr/lib/sendmail /usr/sbin/sendmail
747     echo "SENDMAIL $found -t" >$MIXDEST/mix.cfg
748     cat mix.cfg >>$MIXDEST/mix.cfg
749     fi
750     echo "Client installation complete."
751     exit
752     fi
753    
754     for i in *.blk
755     do
756     if [ ! -f $MIXDEST/$i ]
757     then
758     cp $i $MIXDEST
759     fi
760     done
761    
762     cd $MIXDEST
763    
764     installed=n
765     if [ -f mix.cfg ]
766     then
767     if grep REMAILERADDR mix.cfg >/dev/null
768     then
769     installed=y
770     fi
771     fi
772    
773     if [ "$installed" = "n" ]
774     then
775     Date=`date`
776     whereis sendmail /usr/lib/sendmail /usr/sbin/sendmail
777     sendmail=$found
778    
779     echo "Mixmaster can be installed in the low-maintenance \`middleman' mode.
780     In that mode, it will send mail to other remailers only, to avoid
781     complaints about anonymous messages."
782     readln "Install as middleman?" n
783     middle=$ans
784    
785     readln "The e-mail address of your remailer:" `whoami`@$HOSTNAME
786     RMA=$ans
787    
788     echo "Do you want Mixmaster to send auto-replies to messages it does not
789     understand (If the address <$RMA> is also used"
790     readln "for mail to be read by a human, type \`n')?" y
791     autoreply=$ans
792    
793     if [ "$middle" = n ]
794     then
795     readln "An address to appear in the \`From:' line of anonymous messages:" `echo $RMA | sed 's/.*@/nobody@/'`
796     RAA=$ans
797    
798     readln "Address for complaints to be sent to:" `echo $RMA | sed 's/.*@/abuse@/'`
799     CA=$ans
800     else
801     RAA=$RMA
802     CA=$RMA
803     fi
804    
805     echo "Choose a name for your remailer. It will appear in remailer status messages."
806     readln "Long name:" "Anonymous Remailer"
807     RMN=$ans
808    
809     if [ "$middle" = n ]
810     then
811     echo "Choose a name to be used in the \`From:' line of remailed messages."
812     readln "Anon long name:" "Anonymous"
813     RAN=$ans
814     fi
815    
816     readln "A short name to appear in lists:" `echo $HOSTNAME|sed 's/\..*//'`
817     SN=$ans
818    
819     readln "Accept Mixmaster (Type II) messages?" y
820     mix=$ans
821    
822 rabbi 93 readln "Accept PGP (Type I) remailer messages?" n
823 rabbi 1 pgp=$ans
824    
825     unencrypted=n
826     if [ "$pgp" = "y" ]
827     then
828     readln "Accept unencrypted remailer messages?" n
829     unencrypted=$ans
830     fi
831    
832     echo "Mixmaster will log error messages and warnings. Do you want to log"
833     readln "informational messages about normal operation as well?" y
834     if [ "$ans" = y ]
835     then
836     verbose=2
837     else
838     verbose=1
839     fi
840    
841     readln "Filter binary attachments?" n
842     binfilter=$ans
843    
844     if [ "$middle" = n ]
845     then
846     if [ "$autoreply" = y ]
847     then
848     readln "Allow users to add themselves to the list of blocked addresses?" y
849     autoblock=$ans
850     fi
851    
852     echo "Do you want to allow posting? Newsgroups can be restricted in dest.blk.
853     y)es, post locally; use m)ail-to-news gateway; n)o."
854     readln "Allow posting to Usenet?" m
855     post="$ans"
856     if [ "$ans" = y ]
857     then
858     whereis inews /usr/lib/news/inews
859     readln "News posting software:" "$found -h"
860     news=$ans
861     readln "Organization line for anonymous Usenet posts:" "Anonymous Posting Service"
862     orga=$ans
863     readln "Use anti-spam message IDs?" y
864     mid=$ans
865     elif [ "$ans" = m ]
866     then
867     readln "Mail-to-news gateway:" mail2news@nym.alias.net
868     news=$ans
869     fi
870     fi
871    
872     echo "How many messages do you want to keep in the reordering pool?
873     A larger pool is more secure, but also causes higher latency.
874     0 means to remail immediately."
875     readln "Pool size:" 20
876     poolsize=$ans
877    
878     mbox=
879     if [ -f ~/.forward ]
880     then
881     mbox=`head -1 ~/.forward | sed 's/^"//;s/"$//'`
882     if echo "$mbox" | grep 'mix' >/dev/null 2>/dev/null
883     then
884     mbox=
885     elif echo "$mbox" | grep 'procmail' >/dev/null 2>/dev/null
886     then
887     if grep mix ~/.procmailrc >/dev/null 2>/dev/null
888     then
889     mbox=
890     fi
891     fi
892     fi
893    
894     if [ "$mbox" = "" ]
895     then
896     mbox=${MAIL:-/usr/spool/mail/$NAME}
897     touch "$mbox"
898     if [ ! -w "$mbox" ]
899     then
900     echo "$mbox is not writeable."
901     readln "Mailbox for non-remailer messages:" ${MIXDEST}/mbox
902     mbox=$ans
903     fi
904     fi
905    
906     cat <<END >mix.cfg
907     # mix.cfg -- installed $Date
908     SENDMAIL $sendmail -t
909    
910     # Where to store non-remailer messages:
911     MAILBOX $mbox
912     #MAILABUSE mbox.abuse
913     #MAILBLOCK mbox.block
914     #MAILUSAGE mbox.usage
915     #MAILANON mbox.anon
916     #MAILERROR mbox.error
917     #MAILBOUNCE mbox.bounce
918    
919     REMAIL y
920     MIDDLEMAN $middle
921    
922     BINFILTER $binfilter
923     AUTOBLOCK $autoblock
924    
925 rabbi 92 ERRLOG error.log
926 rabbi 1 VERBOSE $verbose
927    
928     # Remailer name and addresses
929     REMAILERADDR $RMA
930     ANONADDR $RAA
931     COMPLAINTS $CA
932    
933     SHORTNAME $SN
934     REMAILERNAME $RMN
935     ANONNAME $RAN
936    
937     # Supported formats:
938     MIX $mix
939     PGP $pgp
940     UNENCRYPTED $unencrypted
941    
942     # Maximum message size in kB (0 for no limit):
943     SIZELIMIT 0
944    
945     # Usenet news:
946     NEWS $news
947     ORGANIZATION $orga
948     MID $mid
949    
950     # Remailing strategy:
951     SENDPOOLTIME 0h
952     POOLSIZE $poolsize
953     RATE 100
954    
955     IDEXP 7d
956     PACKETEXP 7d
957    
958 weaselp 157 $PASSPHRASE
959    
960 rabbi 1 END
961    
962 weaselp 157 fi # not yet installed
963    
964    
965 rabbi 1 REPLACE="s/%RMN/$RMN/g;s/%RMA/$RMA/g;s/%CA/$CA/g;s/%RAA/$RAA/g"
966     if [ "$installed" = "n" ]
967     then
968     cd $MIXCFG
969     if [ ! -f $MIXDEST/help.txt ]
970     then
971     sed "$REPLACE" < intro.hlp >$MIXDEST/help.txt
972     if [ "$mix" = y ]
973     then
974     sed "$REPLACE" < mix.hlp >>$MIXDEST/help.txt
975     fi
976     if [ "$unencrypted" = y ]
977     then
978     sed "$REPLACE" < type1.hlp >>$MIXDEST/help.txt
979     if [ "$pgp" = y ]
980     then
981     sed "$REPLACE" < pgp.hlp >>$MIXDEST/help.txt
982     fi
983     elif [ "$pgp" = y ]
984     then
985     sed "$REPLACE" < pgponly.hlp >>$MIXDEST/help.txt
986     fi
987     if [ "$post" = y ]
988     then
989     if [ "$pgp" = y -o "$unencrypted" = y ]
990     then
991     sed "$REPLACE" < news.hlp >>$MIXDEST/help.txt
992     fi
993     fi
994     sed "$REPLACE" < end.hlp >>$MIXDEST/help.txt
995     fi
996    
997     for i in *.txt.in
998     do
999     j=`echo $i | sed 's/\.in$//'`
1000     if [ ! -f $MIXDEST/$j ]
1001     then
1002     sed "$REPLACE" < $i >$MIXDEST/$j
1003     fi
1004     done
1005     cd $MIXDEST
1006     fi
1007    
1008     echo
1009     if [ ! -f secring.mix ]
1010     then
1011     echo "Generating secret keys. This may take a while..."
1012     else
1013     echo "Updating secret keys..."
1014     fi
1015     ./mix -K
1016     if [ -f key.txt ]
1017     then
1018     echo "Done."
1019     echo
1020     else
1021     echo "Installation failed. Please consult the Mixmaster documentation."
1022     exit 1
1023     fi
1024    
1025     if [ "$system" = msdos -o "$system" = win32 ]
1026     then
1027     exit
1028     fi
1029    
1030     umask 033
1031    
1032     # Set .forward?
1033     set=y
1034    
1035     if grep procmail ~/.forward >/dev/null 2>/dev/null
1036     then
1037     if grep mix ~/.procmailrc >/dev/null 2>/dev/null
1038     then
1039     echo "Mixmaster is installed in your .procmailrc file."
1040     set=n
1041     fi
1042     fi
1043    
1044     if [ "$set" = y -a -f ~/.forward ]
1045     then
1046     echo "Your current .forward is:"
1047     cat ~/.forward
1048     echo
1049     if grep mix ~/.forward >/dev/null 2>/dev/null
1050     then
1051     echo "Mixmaster already is installed in your .forward file."
1052     set=n
1053     elif [ "$mbox" != "" ]
1054     then
1055     if echo "$mbox" | grep '|' >/dev/null 2>/dev/null
1056     then
1057     echo "Mixmaster will pipe messages to $mbox"
1058     elif echo $mbox | grep '@' >/dev/null 2>/dev/null
1059     then
1060     echo "Mixmaster will forward messages to $mbox"
1061     else
1062     echo "Mixmaster will store messages to $mbox"
1063     fi
1064     fi
1065     fi
1066    
1067     if [ "$set" = y ]
1068     then
1069     echo "Set .forward to the following line:"
1070     echo "\"|${MIXDEST}/mix -RM\""
1071     if [ -f ~/.forward ]
1072     then
1073     readln "Overwrite now?" n
1074     else
1075 weaselp 112 readln "Do that now?" n
1076 rabbi 1 fi
1077     if [ "$ans" = "y" ]
1078     then
1079     echo "\"|${MIXDEST}/mix -RM\"" >~/.forward
1080     fi
1081     fi
1082    
1083     if [ "$RMA" != "" ]
1084     then
1085     echo "
1086     Mixmaster will send the following files as auto-replies:
1087     Mail to <$RMA> with Subject: remailer-help => help.txt"
1088     echo "Mail to <$RMA> with Subject: remailer-adminkey => adminkey.txt
1089     Remember to add your Remailer Admin public PGP key to the adminkey.txt file."
1090     if [ "$autoblock" = y ]
1091     then
1092     echo "Mail to <$RMA> with line DESTINATION-BLOCK => blocked.txt"
1093     fi
1094     if [ "$autoreply" = y ]
1095     then
1096     echo "Other mail to <$RMA> => usage.txt"
1097     echo
1098     if [ "$CA" != "$RMA" ]
1099     then
1100     echo "If you arrange for mail to <$CA> and <$RAA>
1101     to be forwarded to <$RMA>:
1102     Mail to <$CA> => abuse.txt
1103     Mail to <$RAA> => reply.txt"
1104     fi
1105     fi
1106     fi
1107    
1108     echo
1109     echo "Mixmaster installation complete."
1110    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5