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

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5