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

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5