/[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 389 - (show annotations) (download)
Thu Dec 5 04:59:09 2002 UTC (10 years, 5 months ago) by weaselp
File size: 21772 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.8.2.9 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 -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 void *dummy;
669 dummy = idea_cfb64_encrypt;
670 exit(0);
671 }
672 END
673 if gcc $INC tmptst.c -o /dev/null
674 then
675 DEF="$DEF -DUSE_IDEA"
676 else
677 echo "WARNING: Building without IDEA. This means (among other things) that
678 Mixmaster will not create an RSA OpenPGP key (to cut down mail loss)"
679 fi
680 rm -f tmptst.c
681 fi
682
683
684 # if [ "$MIXDEST" = "$HOME/Mix" ]
685 # then
686 # SPOOL=
687 # else
688 SPOOL=-DSPOOL=\'\"$MIXDEST\"\'
689 # fi
690
691 echo "Generating Makefile."
692 echo "#Makefile generated on $HOSTNAME `date`" >Makefile
693 sed -e "s#%MIXDIR#$SPOOL#" \
694 -e "s#%LIBS#$LIBS#" \
695 -e "s#%LDFLAGS#$LDFLAGS#" \
696 -e "s#%INC#$INC#" \
697 -e "s#%DEF#$DEF#" < Makefile.in >> Makefile
698 echo "$ZLIB" >>Makefile
699 echo "$PCRE" >>Makefile
700 echo "$IDEALIB" >>Makefile
701 echo "$NCURSES" >>Makefile
702 echo "$OPENSSL" >>Makefile
703 fi
704
705
706
707
708
709 echo "Compiling. Please wait."
710 whereis make
711 make=$found
712
713 if [ "$system" = win32 ]
714 then
715 (cd zlib*; make libz.a)
716 (cd pcre*; make libpcre.a)
717 if [ "$PASS" != "" ]
718 then
719 $make "$PASS" dllmix
720 else
721 $make dllmix
722 fi
723 else
724 if [ "$PASS" != "" ]
725 then
726 $make "$PASS"
727 else
728 $make
729 fi
730 fi
731
732 if [ -x mix ]
733 then
734 echo
735 else
736 echo "Error: The compilation failed. Please consult the documentation (section
737 \`Installation problems')."
738 readln "Remove the old Makefile?" y
739 if [ "$ans" = y ]
740 then
741 rm -f Makefile
742 fi
743 exit 1
744 fi
745
746 if [ -f $MIXDEST/mixmaster.conf -a ! -f $MIXDEST/mix.cfg ]
747 then
748 export MIXDEST
749 export MIXDIR
750 export MIXSRC
751 ${MIXDIR}/upgrade
752 exit 0
753 fi
754
755 if [ -f mix.exe ]
756 then
757 cp mix.exe $MIXDEST
758 else
759 cp -f mix $MIXDEST
760 fi
761
762 cd $MIXCFG
763 for i in mlist.txt pubring.mix rlist.txt pubring.asc
764 do
765 if [ ! -f $MIXDEST/$i ]
766 then
767 cp $i $MIXDEST
768 fi
769 done
770
771 if [ "$remailer" = "y" ]
772 then
773 cd $MIXCFG
774 for i in adminkey.txt dest.alw
775 do
776 if [ ! -f $MIXDEST/$i ]
777 then
778 cp $i $MIXDEST
779 fi
780 done
781 fi
782
783 if [ "$remailer" = "n" ]
784 then
785 if [ ! -f $MIXDEST/mix.cfg ]
786 then
787 whereis sendmail /usr/lib/sendmail /usr/sbin/sendmail
788 echo "SENDMAIL $found -t" >$MIXDEST/mix.cfg
789 cat mix.cfg >>$MIXDEST/mix.cfg
790 fi
791 echo "Client installation complete."
792 exit
793 fi
794
795 for i in *.blk
796 do
797 if [ ! -f $MIXDEST/$i ]
798 then
799 cp $i $MIXDEST
800 fi
801 done
802
803 cd $MIXDEST
804
805 installed=n
806 if [ -f mix.cfg ]
807 then
808 if grep -i REMAILERADDR mix.cfg >/dev/null
809 then
810 installed=y
811 fi
812 fi
813
814 if [ "$installed" = "n" ]
815 then
816 Date=`date`
817 whereis sendmail /usr/lib/sendmail /usr/sbin/sendmail
818 sendmail=$found
819
820 echo "Mixmaster can be installed in the low-maintenance \`middleman' mode.
821 In that mode, it will send mail to other remailers only, to avoid
822 complaints about anonymous messages."
823 readln "Install as middleman?" n
824 middle=$ans
825
826 readln "The e-mail address of your remailer:" `whoami`@$HOSTNAME
827 RMA=$ans
828
829 echo "Do you want Mixmaster to send auto-replies to messages it does not
830 understand (If the address <$RMA> is also used"
831 readln "for mail to be read by a human, type \`n')?" y
832 autoreply=$ans
833
834 if [ "$middle" = n ]
835 then
836 readln "An address to appear in the \`From:' line of anonymous messages:" `echo $RMA | sed 's/.*@/nobody@/'`
837 RAA=$ans
838
839 readln "Address for complaints to be sent to:" `echo $RMA | sed 's/.*@/abuse@/'`
840 CA=$ans
841 else
842 RAA=$RMA
843 CA=$RMA
844 fi
845
846 echo "Choose a name for your remailer. It will appear in remailer status messages."
847 readln "Long name:" "Anonymous Remailer"
848 RMN=$ans
849
850 if [ "$middle" = n ]
851 then
852 echo "Choose a name to be used in the \`From:' line of remailed messages."
853 readln "Anon long name:" "Anonymous"
854 RAN=$ans
855 fi
856
857 readln "A short name to appear in lists:" `echo $HOSTNAME|sed 's/\..*//'`
858 SN=$ans
859
860 readln "Accept Mixmaster (Type II) messages?" y
861 mix=$ans
862
863 readln "Accept PGP (Type I) remailer messages?" n
864 pgp=$ans
865
866 unencrypted=n
867 if [ "$pgp" = "y" ]
868 then
869 readln "Accept unencrypted remailer messages?" n
870 unencrypted=$ans
871 fi
872
873 echo "Mixmaster will log error messages and warnings. Do you want to log"
874 readln "informational messages about normal operation as well?" y
875 if [ "$ans" = y ]
876 then
877 verbose=2
878 else
879 verbose=1
880 fi
881
882 readln "Filter binary attachments?" n
883 binfilter=$ans
884
885 if [ "$middle" = n ]
886 then
887 if [ "$autoreply" = y ]
888 then
889 readln "Allow users to add themselves to the list of blocked addresses?" y
890 autoblock=$ans
891 fi
892
893 echo "Do you want to allow posting? Newsgroups can be restricted in dest.blk.
894 y)es, post locally; use m)ail-to-news gateway; n)o."
895 readln "Allow posting to Usenet?" m
896 post="$ans"
897 if [ "$ans" = y ]
898 then
899 whereis inews /usr/lib/news/inews
900 readln "News posting software:" "$found -h"
901 news=$ans
902 readln "Organization line for anonymous Usenet posts:" "Anonymous Posting Service"
903 orga=$ans
904 readln "Use anti-spam message IDs?" y
905 mid=$ans
906 elif [ "$ans" = m ]
907 then
908 readln "Mail-to-news gateway:" mail2news@nym.alias.net
909 news=$ans
910 fi
911 fi
912
913 echo "How many messages do you want to keep in the reordering pool?
914 A larger pool is more secure, but also causes higher latency.
915 0 means to remail immediately."
916 readln "Pool size:" 20
917 poolsize=$ans
918
919 mbox=
920 if [ -f ~/.forward ]
921 then
922 mbox=`head -1 ~/.forward | sed 's/^"//;s/"$//'`
923 if echo "$mbox" | grep 'mix' >/dev/null 2>/dev/null
924 then
925 mbox=
926 elif echo "$mbox" | grep 'procmail' >/dev/null 2>/dev/null
927 then
928 if grep mix ~/.procmailrc >/dev/null 2>/dev/null
929 then
930 mbox=
931 fi
932 fi
933 fi
934
935 if [ "$mbox" = "" ]
936 then
937 mbox=${MAIL:-/usr/spool/mail/$NAME}
938 touch "$mbox"
939 if [ ! -w "$mbox" ]
940 then
941 echo "$mbox is not writeable."
942 readln "Mailbox for non-remailer messages:" ${MIXDEST}/mbox
943 mbox=$ans
944 fi
945 fi
946
947 cat <<END >mix.cfg
948 # mix.cfg -- installed $Date
949 SENDMAIL $sendmail -t
950
951 # Where to store non-remailer messages:
952 MAILBOX $mbox
953 #MAILABUSE mbox.abuse
954 #MAILBLOCK mbox.block
955 #MAILUSAGE mbox.usage
956 #MAILANON mbox.anon
957 #MAILERROR mbox.error
958 #MAILBOUNCE mbox.bounce
959
960 REMAIL y
961 MIDDLEMAN $middle
962
963 BINFILTER $binfilter
964 AUTOBLOCK $autoblock
965
966 ERRLOG error.log
967 VERBOSE $verbose
968
969 # Remailer name and addresses
970 REMAILERADDR $RMA
971 ANONADDR $RAA
972 COMPLAINTS $CA
973
974 SHORTNAME $SN
975 REMAILERNAME $RMN
976 ANONNAME $RAN
977
978 # Supported formats:
979 MIX $mix
980 PGP $pgp
981 UNENCRYPTED $unencrypted
982
983 # Maximum message size in kB (0 for no limit):
984 SIZELIMIT 0
985
986 # Usenet news:
987 NEWS $news
988 ORGANIZATION $orga
989 MID $mid
990
991 # Remailing strategy:
992 SENDPOOLTIME 1h
993 POOLSIZE $poolsize
994 RATE 95
995 IDEXP 7d
996 PACKETEXP 7d
997
998 $PASSPHRASE
999
1000 END
1001
1002 fi # not yet installed
1003
1004
1005 REPLACE="s/%RMN/$RMN/g;s/%RMA/$RMA/g;s/%CA/$CA/g;s/%RAA/$RAA/g"
1006 if [ "$installed" = "n" ]
1007 then
1008 cd $MIXCFG
1009 if [ ! -f $MIXDEST/help.txt ]
1010 then
1011 sed "$REPLACE" < intro.hlp >$MIXDEST/help.txt
1012 if [ "$mix" = y ]
1013 then
1014 sed "$REPLACE" < mix.hlp >>$MIXDEST/help.txt
1015 fi
1016 if [ "$unencrypted" = y ]
1017 then
1018 sed "$REPLACE" < type1.hlp >>$MIXDEST/help.txt
1019 if [ "$pgp" = y ]
1020 then
1021 sed "$REPLACE" < pgp.hlp >>$MIXDEST/help.txt
1022 fi
1023 elif [ "$pgp" = y ]
1024 then
1025 sed "$REPLACE" < pgponly.hlp >>$MIXDEST/help.txt
1026 fi
1027 if [ "$post" = y ]
1028 then
1029 if [ "$pgp" = y -o "$unencrypted" = y ]
1030 then
1031 sed "$REPLACE" < news.hlp >>$MIXDEST/help.txt
1032 fi
1033 fi
1034 sed "$REPLACE" < end.hlp >>$MIXDEST/help.txt
1035 fi
1036
1037 for i in *.txt.in
1038 do
1039 j=`echo $i | sed 's/\.in$//'`
1040 if [ ! -f $MIXDEST/$j ]
1041 then
1042 sed "$REPLACE" < $i >$MIXDEST/$j
1043 fi
1044 done
1045 cd $MIXDEST
1046 fi
1047
1048 echo
1049 if [ ! -f secring.mix ]
1050 then
1051 echo "Generating secret keys. This may take a while..."
1052 else
1053 echo "Updating secret keys..."
1054 fi
1055 ./mix -K
1056 if [ -f key.txt ]
1057 then
1058 echo "Done."
1059 echo
1060 else
1061 echo "Installation failed. Please consult the Mixmaster documentation."
1062 exit 1
1063 fi
1064
1065 if [ "$system" = msdos -o "$system" = win32 ]
1066 then
1067 exit
1068 fi
1069
1070 umask 033
1071
1072 # Set .forward?
1073 set=y
1074
1075 if grep procmail ~/.forward >/dev/null 2>/dev/null
1076 then
1077 if grep mix ~/.procmailrc >/dev/null 2>/dev/null
1078 then
1079 echo "Mixmaster is installed in your .procmailrc file."
1080 set=n
1081 fi
1082 fi
1083
1084 if [ "$set" = y -a -f ~/.forward ]
1085 then
1086 echo "Your current .forward is:"
1087 cat ~/.forward
1088 echo
1089 if grep mix ~/.forward >/dev/null 2>/dev/null
1090 then
1091 echo "Mixmaster already is installed in your .forward file."
1092 set=n
1093 elif [ "$mbox" != "" ]
1094 then
1095 if echo "$mbox" | grep '|' >/dev/null 2>/dev/null
1096 then
1097 echo "Mixmaster will pipe messages to $mbox"
1098 elif echo $mbox | grep '@' >/dev/null 2>/dev/null
1099 then
1100 echo "Mixmaster will forward messages to $mbox"
1101 else
1102 echo "Mixmaster will store messages to $mbox"
1103 fi
1104 fi
1105 fi
1106
1107 if [ "$set" = y ]
1108 then
1109 echo "Set .forward to the following line:"
1110 echo "\"|${MIXDEST}/mix -RM\""
1111 if [ -f ~/.forward ]
1112 then
1113 readln "Overwrite now?" n
1114 else
1115 readln "Do that now?" n
1116 fi
1117 if [ "$ans" = "y" ]
1118 then
1119 echo "\"|${MIXDEST}/mix -RM\"" >~/.forward
1120 fi
1121 fi
1122
1123 if [ "$RMA" != "" ]
1124 then
1125 echo "
1126 Mixmaster will send the following files as auto-replies:
1127 Mail to <$RMA> with Subject: remailer-help => help.txt"
1128 echo "Mail to <$RMA> with Subject: remailer-adminkey => adminkey.txt
1129 Remember to add your Remailer Admin public PGP key to the adminkey.txt file."
1130 if [ "$autoblock" = y ]
1131 then
1132 echo "Mail to <$RMA> with line DESTINATION-BLOCK => blocked.txt"
1133 fi
1134 if [ "$autoreply" = y ]
1135 then
1136 echo "Other mail to <$RMA> => usage.txt"
1137 echo
1138 if [ "$CA" != "$RMA" ]
1139 then
1140 echo "If you arrange for mail to <$CA> and <$RAA>
1141 to be forwarded to <$RMA>:
1142 Mail to <$CA> => abuse.txt
1143 Mail to <$RAA> => reply.txt"
1144 fi
1145 fi
1146 fi
1147
1148 echo
1149 echo "Mixmaster installation complete."

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5