/[pkg-mixmaster]/branches/mixmaster_2_9_STABLE/Mix/Install
ViewVC logotype

Contents of /branches/mixmaster_2_9_STABLE/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5