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

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5