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

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


Revision 220 - (show annotations) (download)
Fri Sep 6 21:04:16 2002 UTC (10 years, 8 months ago) by rabbi
File size: 21449 byte(s)
Updated documentation for {IN,OUT}DUMMYP, and to reflect changes in
remailer defaults.

Mixmaster now has a sanity-check on the number of dummy messages
generated automatically.

Fixed typos in mix.1 and Install.

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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5