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

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


Revision 341 - (hide annotations) (download)
Wed Oct 9 21:45:07 2002 UTC (10 years, 7 months ago) by weaselp
File size: 21625 byte(s)
Removed trailing whitespace
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 341 # $Id: Install,v 1.20 2002/10/09 21:45:06 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 weaselp 341 then
131 rabbi 1 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 rabbi 220 echo "Found a Makefile for this system."
267     readln "Use this Makefile?" y
268     if [ "$ans" = n ]
269     then
270     rm -f $MIXSRC/Makefile
271     fi
272 rabbi 1 else
273     readln "Remove old Makefile?" y
274     if [ "$ans" = y ]
275     then
276     rm -f $MIXSRC/Makefile
277     fi
278     fi
279     fi
280    
281     if [ -f $MIXSRC/Makefile ]
282     then
283     MIXDEST=`grep "DSPOOL=" $MIXSRC/Makefile | sed 's/.*DSPOOL=..//;s/\".*//'`
284     if [ "$MIXDEST" = "" ]
285     then
286     MIXDEST="$MIXDEST0"
287     fi
288     fi
289    
290     if [ "$MIXDEST" = "" ]
291     then
292     readln "Mixmaster directory?" $MIXDEST0
293     MIXDEST=$ans
294     else
295     echo "Mixmaster directory: $MIXDEST"
296     fi
297    
298     if [ ! -d $MIXDEST ]
299     then
300     echo "Creating directory $MIXDEST"
301     mkdir $MIXDEST
302     fi
303    
304     if [ ! -d $MIXDEST ]
305     then
306     echo "Cannot not create $MIXDEST"
307     exit 1
308     fi
309    
310     if [ -f $MIXDEST/mix.cfg ]
311     then
312     if [ -f $MIXDEST/secring.mix ]
313     then
314     remailer=y
315 weaselp 157 if grep PASSPHRASE $MIXDEST/mix.cfg >/dev/null
316     then
317     PASSINCONFIG=1
318     fi
319 rabbi 1 else
320     readln "Do you want to set up a remailer?" n
321     remailer=$ans
322     fi
323     elif [ -f $MIXDEST/mixmaster.conf ]
324     then
325     echo "Upgrading from Mixmaster 2.0.*"
326     remailer=n
327     else
328     readln "Do you want to set up a remailer?" y
329     remailer=$ans
330     fi
331    
332 weaselp 157
333     ans=""
334     if [ "$remailer" = "y" ]
335     then
336     ans="n"
337     if [ "$PASSINCONFIG" != 1 ]
338     then
339 rabbi 241 echo ""
340     echo "You can either compile your secret passphrase into the binary
341 weaselp 157 or you can set it in your config file. Note that the former does not
342 rabbi 241 really increase security as the passphrase can still be discovered by
343     running something like »strings mix«."
344     echo ""
345     echo "Most users should answer »n« to this question:"
346     echo ""
347 rabbi 193 readln "Do you want to compile the passphrase into the binary?" n
348 weaselp 157 fi
349    
350     rm -f "$MIXSRC/mix.o" # make sure our new passphrase takes effect
351     if [ "$ans" = "y" ]
352     then
353     ans=""
354 rabbi 220 echo "Please enter a passphrase for your remailer (must be the same
355 weaselp 157 whenever you re-compile Mixmaster)."
356     read ans
357    
358     if [ "$ans" != "" ]
359     then
360     PASS="PASS=$ans"
361     else
362     echo "WARNING: not setting a passphrase"
363     fi
364     else
365     if [ "$PASSINCONFIG" != 1 ]
366     then
367     ans=""
368 rabbi 220 echo "Please enter a passphrase for your remailer (it will be
369 weaselp 157 stored in mix.cfg in clear)."
370     read ans
371    
372 rabbi 209 if [ "$ans" = "" ]
373 weaselp 157 then
374     echo "WARNING: setting empty passphrase"
375     fi
376 weaselp 341 PASSPHRASE="PASSPHRASE $ans"
377 weaselp 236 if [ -f $MIXDEST/mix.cfg ]
378 rabbi 233 then
379 weaselp 236 echo "$PASSPHRASE" >> $MIXDEST/mix.cfg
380 rabbi 232 fi
381 weaselp 157 fi
382     fi
383     fi
384    
385    
386 rabbi 1 cd $MIXSRC
387     if [ ! -f Makefile ]
388     then
389     LIBS=
390     INC=
391     DEF=
392     LDFLAGS=
393    
394 weaselp 157 if [ ! -z "$PASS" ]
395     then
396     DEF="$DEF -DCOMPILEDPASS='\"\$(PASS)\"'"
397     fi
398    
399 rabbi 1 if [ "$system" = msdos ]
400     then
401     readln "Use WIN32 GUI?" y
402     if [ "$ans" = y ]
403     then
404     system=win32
405     LDFLAGS=-lwsock32
406     fi
407     fi
408     if [ "$system" = SunOS ]
409     then
410     LDFLAGS="-lsocket -lnsl"
411     fi
412    
413     LIBDIR=
414     INCDIR=
415     SRCDIR=zlib*
416     findlib libz.a
417     if [ "$found" = "" ]
418     then
419     readln "Continue anyway?" n
420     if [ "$ans" = "n" ]
421     then
422 rabbi 100 echo "Please install zlib 1.1.4 or greater now."
423 rabbi 1 exit 1
424     fi
425     else
426     ZLIB="$MAKELIB"
427     DEF="$DEF -DUSE_ZLIB"
428     LIBS="$LIBS $LIB"
429     LDFLAGS="$LDFLAGS $LDFLAG"
430     if [ "$INCDIR" != "" ]
431     then
432     INC="$INC -I$INCDIR"
433     fi
434     fi
435    
436     LIBDIR=
437     INCDIR=
438     SRCDIR=pcre*
439     findlib libpcre.a
440     if [ "$found" != "" ]
441     then
442     PCRE="$MAKELIB"
443     DEF="$DEF -DUSE_PCRE"
444     LIBS="$LIBS $LIB"
445     LDFLAGS="$LDFLAGS $LDFLAG"
446     if [ "$INCDIR" != "" ]
447     then
448     INC="$INC -I$INCDIR"
449     fi
450     fi
451    
452 rabbi 125 opensslinfo="Please get OpenSSL 0.9.6f or greater from http://www.openssl.org/"
453     opensslwarning="WARNING: This version of OpenSSL contains known vulnerabilities. Please upgrade to OpenSSL 0.9.6f or greater!"
454 rabbi 1 LIBDIR=/usr/local/ssl/lib
455     INCDIR="/usr/include /usr/include/ssl /usr/lib/ssl/include /usr/local/ssl/include"
456     SRCDIR="openssl*"
457    
458 rabbi 209 opensslwarn()
459     {
460     echo $opensslwarning
461     readln "Continue anyway?" y
462     if [ "$ans" = "n" ]
463     then
464     echo $opensslinfo
465     exit 1
466     fi
467     }
468    
469 rabbi 1 if [ "$system" = win32 ]
470     then
471     findlib libeay32.a
472     else
473     findlib libcrypto.a
474     fi
475     if [ "$found" = "" ]
476     then
477     echo $opensslinfo
478     exit 1
479     fi
480    
481     LIBS="$LIBS $LIB"
482     LDFLAGS="$LDFLAGS $LDFLAG"
483     if [ "$MAKELIB" != "" ]
484     then
485     OPENSSL="$found/$lib:
486     cd $found/crypto; make"
487     fi
488     if [ -d "$INCDIR/openssl" ]
489     then
490     INC="$INC -I$INCDIR"
491     else
492     # detect old SSLeay versions
493     if [ -f "$INCDIR/crypto.h" ]
494     then
495     version=800
496     if grep OPENSSL "$INCDIR/crypto.h" > /dev/null
497     then
498     version=920
499     fi
500     fi
501 weaselp 341 fi
502 rabbi 1
503     # Find the OpenSSL version header
504 rabbi 93 if [ -f $INCDIR/openssl/opensslv.h ]
505 rabbi 1 then
506 rabbi 93 version=`grep 'SSL.*_VERSION_NUMBER.*0x' $INCDIR/openssl/opensslv.h | sed 's/.*0x0*//;s/[ ].*//;s/L$//'`
507     elif [ -f $INCDIR/opensslv.h ]
508     then
509 rabbi 8 version=`grep 'SSL.*_VERSION_NUMBER.*0x' $INCDIR/opensslv.h | sed 's/.*0x0*//;s/[ ].*//;s/L$//'`
510 rabbi 1 fi
511     if [ "$version" = "" ]
512     then
513     echo "Warning: Can't find OpenSSL version number!"
514     readln "Continue anyway?" y
515     if [ "$ans" = "n" ]
516     then
517     echo $opensslinfo
518     exit 1
519     fi
520 rabbi 210 elif [ "$version" = "90581f" ]
521 rabbi 1 then
522 rabbi 100 echo "Compiling with OpenSSL 0.9.5a."
523 rabbi 209 opensslwarn
524 rabbi 210 elif [ "$version" = "90601f" ]
525 rabbi 100 then
526 rabbi 93 echo "Compiling with OpenSSL 0.9.6a."
527 rabbi 209 opensslwarn
528 rabbi 210 elif [ "$version" = "90602f" ]
529 rabbi 93 then
530     echo "Compiling with OpenSSL 0.9.6b."
531 rabbi 209 opensslwarn
532 rabbi 210 elif [ "$version" = "90603f" ]
533 rabbi 93 then
534     echo "Compiling with OpenSSL 0.9.6c."
535 rabbi 209 opensslwarn
536 rabbi 210 elif [ "$version" = "90604f" ]
537 rabbi 93 then
538     echo "Compiling with OpenSSL 0.9.6d."
539 rabbi 209 opensslwarn
540 rabbi 210 elif [ "$version" = "90605f" ]
541 rabbi 125 then
542     echo "Compiling with OpenSSL 0.9.6e."
543 rabbi 209 opensslwarn
544 rabbi 210 elif [ "$version" = "90606f" ]
545 rabbi 125 then
546     echo "Compiling with OpenSSL 0.9.6f."
547 rabbi 210 elif [ "$version" = "90607f" ]
548 rabbi 125 then
549     echo "Compiling with OpenSSL 0.9.6g."
550 rabbi 210 elif [ "$version" = "907001" ]
551     then
552     echo "Compiling with OpenSSL 0.9.7beta1."
553     opensslwarn
554     elif [ "$version" = "907002" ]
555     then
556     echo "Compiling with OpenSSL 0.9.7beta2."
557     opensslwarn
558     elif [ "$version" = "907003" ]
559     then
560     echo "Compiling with OpenSSL 0.9.7beta3."
561 rabbi 93 elif [ "$version" -lt "920" ]
562     then
563 rabbi 8 echo "This version: ${version} of SSLeay is not supported."
564 rabbi 1 echo $opensslinfo
565     exit 1
566 rabbi 93 elif [ "$version" -lt "903100" ]
567 rabbi 1 then
568 rabbi 8 echo "This version: ${version} of OpenSSL is not supported."
569 rabbi 1 echo $opensslinfo
570     exit 1
571 rabbi 93 elif [ "$version" -gt "906000" ]
572 rabbi 1 then
573 rabbi 8 echo "Warning: This version: ${version} of OpenSSL is untested."
574 rabbi 1 readln "Continue anyway?" y
575     if [ "$ans" = "n" ]
576     then
577     echo $opensslinfo
578     exit 1
579     fi
580     fi
581    
582     LIBDIR=
583     INCDIR=/usr/include/ncurses
584     SRCDIR=ncurses*
585     CONFIG=--enable-termcap
586     if [ "$TERMINFO" != "" ]
587     then
588     CONFIG="--datadir=$TERMINFO"
589     fi
590     if [ -d /usr/share/terminfo ]
591     then
592     CONFIG=
593     fi
594     if [ -d /usr/lib/terminfo ]
595     then
596     CONFIG=--datadir=/usr/lib/terminfo
597     fi
598    
599     if [ `uname` = OpenBSD ]
600     then
601     findlib libcurses.a
602     else
603     findlib libncurses.a
604     fi
605 weaselp 341 if [ "$found" = "" ]
606 rabbi 1 then
607     if [ "$system" != win32 ]
608     then
609     readln "Do you want to use Mixmaster's menu-based user interface?" y
610     if [ "$ans" = "y" ]
611     then
612 weaselp 341 echo "Please install ncurses now. It is available from
613     http://www.clark.net/pub/dickey/ncurses/ncurses.tar.gz"
614 rabbi 1 exit 1
615     fi
616     fi
617     else
618     DEF="$DEF -DUSE_NCURSES"
619     if [ "$type" = system -o "$type" = installed ]
620     then
621     LIBS="$LIBS $LIB"
622     LDFLAGS="$LDFLAGS $LDFLAG"
623     else
624     LIBS="$LIBS $found/lib/$lib"
625     NCURSES="$found/lib/$lib:
626     cd $found/ncurses; make ../lib/$lib"
627     fi
628     if [ "$INCDIR" != "" ]
629     then
630     INC="$INC -I$INCDIR"
631     elif [ -f "/usr/include/ncurses.h" ]
632     then
633     DEF="$DEF -DHAVE_NCURSES_H"
634     fi
635     fi
636    
637 weaselp 159 if [ "$system" = OpenBSD ]
638     then
639     LIBDIR=
640     INCDIR=
641     SRCDIR=idea*
642     findlib libidea.a
643     if [ "$found" = "" ]
644     then
645     echo "WARNING: Building without IDEA. This means (among other things) that
646     Mixmaster will not create an RSA OpenPGP key (to cut down mail loss)"
647     else
648     DEF="$DEF -DUSE_IDEA"
649     IDEALIB="$MAKELIB"
650     LIBS="$LIBS $LIB"
651     LDFLAGS="$LDFLAGS $LDFLAG"
652     if [ "$INCDIR" != "" ]
653     then
654     INC="$INC -I$INCDIR"
655     fi
656     fi
657     elif [ "$system" = msdos -o "$system" = win32 ]
658     then
659     DEF="$DEF -DUSE_IDEA"
660     else
661     cat <<END >tmptst.c
662     #include <openssl/idea.h>
663     int main() {
664     exit(0);
665     }
666     END
667 weaselp 174 if gcc $INC tmptst.c -c -o /dev/null
668 weaselp 159 then
669     DEF="$DEF -DUSE_IDEA"
670     else
671     echo "WARNING: Building without IDEA. This means (among other things) that
672     Mixmaster will not create an RSA OpenPGP key (to cut down mail loss)"
673     fi
674     rm -f tmptst.c
675     fi
676    
677    
678 rabbi 1 # if [ "$MIXDEST" = "$HOME/Mix" ]
679     # then
680     # SPOOL=
681     # else
682     SPOOL=-DSPOOL=\'\"$MIXDEST\"\'
683     # fi
684    
685     echo "Generating Makefile."
686     echo "#Makefile generated on $HOSTNAME `date`" >Makefile
687     sed -e "s#%MIXDIR#$SPOOL#" \
688     -e "s#%LIBS#$LIBS#" \
689     -e "s#%LDFLAGS#$LDFLAGS#" \
690     -e "s#%INC#$INC#" \
691     -e "s#%DEF#$DEF#" < Makefile.in >> Makefile
692     echo "$ZLIB" >>Makefile
693     echo "$PCRE" >>Makefile
694 rabbi 8 echo "$IDEALIB" >>Makefile
695 rabbi 1 echo "$NCURSES" >>Makefile
696     echo "$OPENSSL" >>Makefile
697     fi
698    
699    
700    
701 weaselp 157
702    
703 rabbi 1 echo "Compiling. Please wait."
704     whereis gmake make
705     make=$found
706    
707     if [ "$system" = win32 ]
708     then
709     (cd zlib*; make libz.a)
710     (cd pcre*; make libpcre.a)
711     if [ "$PASS" != "" ]
712     then
713     $make "$PASS" dllmix
714     else
715     $make dllmix
716     fi
717     else
718     if [ "$PASS" != "" ]
719     then
720     $make "$PASS"
721     else
722     $make
723     fi
724     fi
725    
726     if [ -x mix ]
727     then
728     echo
729     else
730     echo "Error: The compilation failed. Please consult the documentation (section
731     \`Installation problems')."
732     readln "Remove the old Makefile?" y
733     if [ "$ans" = y ]
734     then
735     rm -f Makefile
736     fi
737     exit 1
738     fi
739    
740     if [ -f $MIXDEST/mixmaster.conf -a ! -f $MIXDEST/mix.cfg ]
741     then
742     export MIXDEST
743     export MIXDIR
744     export MIXSRC
745     ${MIXDIR}/upgrade
746     exit 0
747     fi
748    
749     if [ -f mix.exe ]
750     then
751     cp mix.exe $MIXDEST
752     else
753     cp mix $MIXDEST
754     fi
755    
756     cd $MIXCFG
757     for i in mlist.txt pubring.mix rlist.txt pubring.asc type2.list
758     do
759     if [ ! -f $MIXDEST/$i ]
760     then
761     cp $i $MIXDEST
762     fi
763     done
764    
765     if [ "$remailer" = "y" ]
766     then
767     cd $MIXCFG
768     for i in adminkey.txt dest.alw
769     do
770     if [ ! -f $MIXDEST/$i ]
771     then
772     cp $i $MIXDEST
773     fi
774     done
775     fi
776    
777     if [ "$remailer" = "n" ]
778     then
779     if [ ! -f $MIXDEST/mix.cfg ]
780     then
781     whereis sendmail /usr/lib/sendmail /usr/sbin/sendmail
782     echo "SENDMAIL $found -t" >$MIXDEST/mix.cfg
783     cat mix.cfg >>$MIXDEST/mix.cfg
784     fi
785     echo "Client installation complete."
786     exit
787     fi
788    
789     for i in *.blk
790     do
791     if [ ! -f $MIXDEST/$i ]
792     then
793     cp $i $MIXDEST
794     fi
795     done
796    
797     cd $MIXDEST
798    
799     installed=n
800     if [ -f mix.cfg ]
801     then
802     if grep REMAILERADDR mix.cfg >/dev/null
803     then
804     installed=y
805     fi
806 weaselp 341 fi
807 rabbi 1
808     if [ "$installed" = "n" ]
809     then
810     Date=`date`
811     whereis sendmail /usr/lib/sendmail /usr/sbin/sendmail
812     sendmail=$found
813    
814     echo "Mixmaster can be installed in the low-maintenance \`middleman' mode.
815     In that mode, it will send mail to other remailers only, to avoid
816     complaints about anonymous messages."
817     readln "Install as middleman?" n
818     middle=$ans
819    
820     readln "The e-mail address of your remailer:" `whoami`@$HOSTNAME
821     RMA=$ans
822    
823     echo "Do you want Mixmaster to send auto-replies to messages it does not
824     understand (If the address <$RMA> is also used"
825     readln "for mail to be read by a human, type \`n')?" y
826     autoreply=$ans
827    
828     if [ "$middle" = n ]
829     then
830     readln "An address to appear in the \`From:' line of anonymous messages:" `echo $RMA | sed 's/.*@/nobody@/'`
831     RAA=$ans
832    
833     readln "Address for complaints to be sent to:" `echo $RMA | sed 's/.*@/abuse@/'`
834     CA=$ans
835     else
836     RAA=$RMA
837     CA=$RMA
838     fi
839    
840     echo "Choose a name for your remailer. It will appear in remailer status messages."
841     readln "Long name:" "Anonymous Remailer"
842     RMN=$ans
843    
844     if [ "$middle" = n ]
845     then
846     echo "Choose a name to be used in the \`From:' line of remailed messages."
847     readln "Anon long name:" "Anonymous"
848     RAN=$ans
849     fi
850    
851     readln "A short name to appear in lists:" `echo $HOSTNAME|sed 's/\..*//'`
852     SN=$ans
853    
854     readln "Accept Mixmaster (Type II) messages?" y
855     mix=$ans
856    
857 rabbi 93 readln "Accept PGP (Type I) remailer messages?" n
858 rabbi 1 pgp=$ans
859    
860     unencrypted=n
861     if [ "$pgp" = "y" ]
862     then
863     readln "Accept unencrypted remailer messages?" n
864     unencrypted=$ans
865     fi
866    
867     echo "Mixmaster will log error messages and warnings. Do you want to log"
868 weaselp 341 readln "informational messages about normal operation as well?" y
869 rabbi 1 if [ "$ans" = y ]
870 weaselp 341 then
871 rabbi 1 verbose=2
872     else
873     verbose=1
874     fi
875    
876     readln "Filter binary attachments?" n
877     binfilter=$ans
878    
879     if [ "$middle" = n ]
880     then
881     if [ "$autoreply" = y ]
882     then
883     readln "Allow users to add themselves to the list of blocked addresses?" y
884     autoblock=$ans
885     fi
886    
887     echo "Do you want to allow posting? Newsgroups can be restricted in dest.blk.
888     y)es, post locally; use m)ail-to-news gateway; n)o."
889     readln "Allow posting to Usenet?" m
890     post="$ans"
891     if [ "$ans" = y ]
892     then
893     whereis inews /usr/lib/news/inews
894     readln "News posting software:" "$found -h"
895     news=$ans
896     readln "Organization line for anonymous Usenet posts:" "Anonymous Posting Service"
897     orga=$ans
898     readln "Use anti-spam message IDs?" y
899     mid=$ans
900     elif [ "$ans" = m ]
901     then
902     readln "Mail-to-news gateway:" mail2news@nym.alias.net
903     news=$ans
904     fi
905     fi
906    
907     echo "How many messages do you want to keep in the reordering pool?
908     A larger pool is more secure, but also causes higher latency.
909     0 means to remail immediately."
910     readln "Pool size:" 20
911     poolsize=$ans
912    
913     mbox=
914     if [ -f ~/.forward ]
915     then
916     mbox=`head -1 ~/.forward | sed 's/^"//;s/"$//'`
917     if echo "$mbox" | grep 'mix' >/dev/null 2>/dev/null
918     then
919     mbox=
920     elif echo "$mbox" | grep 'procmail' >/dev/null 2>/dev/null
921     then
922     if grep mix ~/.procmailrc >/dev/null 2>/dev/null
923     then
924     mbox=
925     fi
926     fi
927     fi
928    
929     if [ "$mbox" = "" ]
930     then
931     mbox=${MAIL:-/usr/spool/mail/$NAME}
932     touch "$mbox"
933     if [ ! -w "$mbox" ]
934     then
935     echo "$mbox is not writeable."
936     readln "Mailbox for non-remailer messages:" ${MIXDEST}/mbox
937     mbox=$ans
938     fi
939     fi
940    
941     cat <<END >mix.cfg
942     # mix.cfg -- installed $Date
943     SENDMAIL $sendmail -t
944    
945     # Where to store non-remailer messages:
946     MAILBOX $mbox
947     #MAILABUSE mbox.abuse
948     #MAILBLOCK mbox.block
949     #MAILUSAGE mbox.usage
950     #MAILANON mbox.anon
951     #MAILERROR mbox.error
952     #MAILBOUNCE mbox.bounce
953    
954     REMAIL y
955     MIDDLEMAN $middle
956    
957     BINFILTER $binfilter
958     AUTOBLOCK $autoblock
959    
960 rabbi 92 ERRLOG error.log
961 rabbi 1 VERBOSE $verbose
962    
963     # Remailer name and addresses
964     REMAILERADDR $RMA
965     ANONADDR $RAA
966     COMPLAINTS $CA
967    
968     SHORTNAME $SN
969     REMAILERNAME $RMN
970     ANONNAME $RAN
971    
972     # Supported formats:
973     MIX $mix
974     PGP $pgp
975     UNENCRYPTED $unencrypted
976    
977     # Maximum message size in kB (0 for no limit):
978     SIZELIMIT 0
979    
980     # Usenet news:
981     NEWS $news
982     ORGANIZATION $orga
983     MID $mid
984    
985     # Remailing strategy:
986 rabbi 220 SENDPOOLTIME 1h
987 rabbi 1 POOLSIZE $poolsize
988 rabbi 220 RATE 95
989     INDUMMYP 20
990     OUTDUMMYP 67
991 rabbi 1 IDEXP 7d
992     PACKETEXP 7d
993    
994 weaselp 157 $PASSPHRASE
995    
996 rabbi 1 END
997    
998 weaselp 157 fi # not yet installed
999    
1000    
1001 rabbi 1 REPLACE="s/%RMN/$RMN/g;s/%RMA/$RMA/g;s/%CA/$CA/g;s/%RAA/$RAA/g"
1002     if [ "$installed" = "n" ]
1003     then
1004     cd $MIXCFG
1005     if [ ! -f $MIXDEST/help.txt ]
1006     then
1007     sed "$REPLACE" < intro.hlp >$MIXDEST/help.txt
1008     if [ "$mix" = y ]
1009     then
1010     sed "$REPLACE" < mix.hlp >>$MIXDEST/help.txt
1011     fi
1012     if [ "$unencrypted" = y ]
1013     then
1014     sed "$REPLACE" < type1.hlp >>$MIXDEST/help.txt
1015     if [ "$pgp" = y ]
1016     then
1017     sed "$REPLACE" < pgp.hlp >>$MIXDEST/help.txt
1018     fi
1019     elif [ "$pgp" = y ]
1020     then
1021     sed "$REPLACE" < pgponly.hlp >>$MIXDEST/help.txt
1022     fi
1023     if [ "$post" = y ]
1024     then
1025     if [ "$pgp" = y -o "$unencrypted" = y ]
1026     then
1027     sed "$REPLACE" < news.hlp >>$MIXDEST/help.txt
1028     fi
1029     fi
1030     sed "$REPLACE" < end.hlp >>$MIXDEST/help.txt
1031     fi
1032    
1033     for i in *.txt.in
1034     do
1035     j=`echo $i | sed 's/\.in$//'`
1036     if [ ! -f $MIXDEST/$j ]
1037     then
1038     sed "$REPLACE" < $i >$MIXDEST/$j
1039     fi
1040     done
1041     cd $MIXDEST
1042     fi
1043    
1044     echo
1045     if [ ! -f secring.mix ]
1046     then
1047     echo "Generating secret keys. This may take a while..."
1048     else
1049     echo "Updating secret keys..."
1050     fi
1051     ./mix -K
1052     if [ -f key.txt ]
1053     then
1054     echo "Done."
1055     echo
1056     else
1057     echo "Installation failed. Please consult the Mixmaster documentation."
1058     exit 1
1059     fi
1060    
1061     if [ "$system" = msdos -o "$system" = win32 ]
1062     then
1063     exit
1064     fi
1065    
1066     umask 033
1067    
1068     # Set .forward?
1069     set=y
1070    
1071     if grep procmail ~/.forward >/dev/null 2>/dev/null
1072     then
1073     if grep mix ~/.procmailrc >/dev/null 2>/dev/null
1074     then
1075     echo "Mixmaster is installed in your .procmailrc file."
1076     set=n
1077     fi
1078     fi
1079    
1080     if [ "$set" = y -a -f ~/.forward ]
1081     then
1082     echo "Your current .forward is:"
1083     cat ~/.forward
1084     echo
1085     if grep mix ~/.forward >/dev/null 2>/dev/null
1086     then
1087     echo "Mixmaster already is installed in your .forward file."
1088     set=n
1089     elif [ "$mbox" != "" ]
1090     then
1091     if echo "$mbox" | grep '|' >/dev/null 2>/dev/null
1092     then
1093     echo "Mixmaster will pipe messages to $mbox"
1094     elif echo $mbox | grep '@' >/dev/null 2>/dev/null
1095     then
1096     echo "Mixmaster will forward messages to $mbox"
1097     else
1098     echo "Mixmaster will store messages to $mbox"
1099     fi
1100     fi
1101     fi
1102    
1103     if [ "$set" = y ]
1104     then
1105     echo "Set .forward to the following line:"
1106     echo "\"|${MIXDEST}/mix -RM\""
1107     if [ -f ~/.forward ]
1108     then
1109     readln "Overwrite now?" n
1110     else
1111 weaselp 112 readln "Do that now?" n
1112 rabbi 1 fi
1113     if [ "$ans" = "y" ]
1114     then
1115     echo "\"|${MIXDEST}/mix -RM\"" >~/.forward
1116     fi
1117     fi
1118    
1119     if [ "$RMA" != "" ]
1120     then
1121     echo "
1122     Mixmaster will send the following files as auto-replies:
1123     Mail to <$RMA> with Subject: remailer-help => help.txt"
1124     echo "Mail to <$RMA> with Subject: remailer-adminkey => adminkey.txt
1125     Remember to add your Remailer Admin public PGP key to the adminkey.txt file."
1126     if [ "$autoblock" = y ]
1127     then
1128     echo "Mail to <$RMA> with line DESTINATION-BLOCK => blocked.txt"
1129     fi
1130     if [ "$autoreply" = y ]
1131     then
1132     echo "Other mail to <$RMA> => usage.txt"
1133     echo
1134     if [ "$CA" != "$RMA" ]
1135     then
1136     echo "If you arrange for mail to <$CA> and <$RAA>
1137     to be forwarded to <$RMA>:
1138     Mail to <$CA> => abuse.txt
1139     Mail to <$RAA> => reply.txt"
1140     fi
1141     fi
1142     fi
1143    
1144     echo
1145     echo "Mixmaster installation complete."
1146    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5