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

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5