1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
#!/bin/sh
#
if test -e deb-conf/junkfilter.config ;
then
echo "Test-mode: using local deb-conf rather than package-based one."
CONF="`pwd`/deb-conf"
else
CONF="/usr/lib/junkfilter/deb-conf"
fi
#
if test -e ~/.procmailrc ;
then
echo "You have procmail configured!"
echo "You must configure your .procmailrc file yourself. Look at"
echo "/usr/doc/junkmail/junkmail.readme.gz and"
echo "${CONF}/procmailrc for"
echo "some ideas. Note the use of JFDIR and JFUSERDIR, which is unique"
echo "to this package distribution of junkfilter"
else
echo "No procmail script for your account - creating it"
cp $CONF/procmailrc ~/.procmailrc
echo "This .procmailrc file only adds headers to indicate junk mail, and"
echo "then puts the mail into your inbox".
fi
#
#
echo ""
if test -d ~/.procmail ;
then
echo "You have your own .procmail directory - you are too clever for me..."
else
echo "Its a good idea to have a .procmail directory to store all the"
echo "procmail filters, so I am creating one for you".
mkdir ~/.procmail
mv ~/.procmailrc ~/.procmail/.procmailrc
ln -s .procmail/.procmailrc ~/.procmailrc
fi
#
#
echo ""
if test -d ~/.procmail/junkfilter ;
then
echo "Updating you to a new version of junkfilter"
echo "Note that your ~/.procmail/junkfilter.config file will be"
echo "preserved, and the new config file is called junkfilter.config.new"
echo " - it is up to you to make use of it!"
echo " Extracting your maildom and mailaddr"
dom="`grep "^JFMAILDOM" ~/.procmail/junkfilter/junkfilter.config`"
addr="`grep "^JFMAILADDRESS" ~/.procmail/junkfilter/junkfilter.config`"
echo " - $dom"
echo " - $addr"
cp $CONF/junkfilter.config ~/.procmail/junkfilter/junkfilter.config.new
echo "$dom" >> ~/.procmail/junkfilter/junkfilter.config.new
echo "$addr" >> ~/.procmail/junkfilter/junkfilter.config.new
else
echo "Installing junkfilter in your local directories"
echo "The config file needs a list of the domains to which you belong, and"
echo "a list of username@domain for which you will receive email here."
echo "I am going to guess - "
dom="(`hostname --domain`|debian.org)"
addr="(@`hostname --domain`|$USER@debian.org)"
echo " JFMAILDOM=$dom"
echo " JFMAILADDRESS=$addr"
mkdir ~/.procmail/junkfilter
cp $CONF/junkfilter.config ~/.procmail/junkfilter/
echo " JFMAILDOM=$dom" >> ~/.procmail/junkfilter/junkfilter.config
echo " JFMAILADDRESS=$addr" >> ~/.procmail/junkfilter/junkfilter.config
fi
|