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

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5