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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5