PPM

From: joe freedom (joefreedom_at_everywhere.org)
Date: 07/22/03


Date: 22 Jul 2003 13:40:08 GMT


PPM Password-Protected-Mailboxes

The only SURE way to eliminate spam.

This is mostly Timo Salmi's system. The scripts at the bottom and a couple
of additions to the .procmailrc are my enhancements. They make the passwords
one-time only. Create a directory ~/procmail and in that directory a file
called passfile with a 'starter password' TSPW[0-9][0-9]*

[ When someone mails you for the first time, their mail will be dumped and
they will receive a note asking them to please re-send the mail putting a
one-time password on the Subject: line, and informed that the mail that uses
that password must come from the same address that was used to acquire it.

In-other-words, NOBODY will be able to contact you without using their real
email address. (Not without more expertise and hassle than any spammer or
punk harasser is able or willing to muster....) ]

If priv/temp correspondents are not mailing from the address(es) in your
..procamilrc, then they can mail you and Cc that address (making it the ONLY
entry on the Cc line).

Make sure you put any first-time contacts in the Temp list and
have a sig that tells them that they must either use the address that the
mail is addressed to, or Cc to it making it the only address on the Cc line.
The scripts priv.sh, sedd1 and sedd2 make adding these entries very simple.

This is designed for a Linux/UNIX system using fetchmail/procmail/formail
that are invoked automatically when you fetch mail from your POP server; and
an sh compatible shell.

Your ~/.fetcmailrc should look something like this:

 poll pop.yourisp.whatever
        tracepolls
        proto pop3
        user "you@your.isp"
        pass "yourpassword"
        is yourusername here
        and wants mda "/usr/bin/formail -ds /usr/bin/procmail"
        fetchall

You can, and should, replace the string TSPW with one that is uniquely yours.
Be sure to do it in all the scripts. :-)

Any improvements on my crude scripts are more than welcome.

Please post them on comp.mail.misc.

Just enough of the .procmailrc to make this work. It needs to be personalized,
of course.
############################################################################

PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin
MAILDIR=$HOME/Mail #you'd better make sure it exists
DEFAULT=$MAILDIR/inbox #completely optional
LOGFILE=$MAILDIR/from #recommended
PASSWD=`cat ~/procmail/passfile`

### First Things

:0 h
* ^Subject.*TSPW[0-9][0-9]*
| cat > ~/procmail/newmail && procpass.sh

### Temp

# (temporary priveleged list)

:0 h
* ^From.*whoever@whatever.isp
* ! ^X-Loop: you@your.isp
${DEFAULT}

:0 h
* ^Cc: same_address_as_immediately_above
* ! ^Cc:.*@.*@
* ! ^X-Loop: you@your.isp
${DEFAULT}

### Priveleged List

# similar entries to above

### Password

:0 hc
* $ ! ^Subject.*${PASSWD}
| net=${PASSWD} ; ten=`sed -n '/^From:/p'`; echo "$net $ten" >> ~/procmail/pr
ocpass

:0:passwd.lock
              * $ ! ^Subject:.*${PASSWD}
              * ! ^X-Loop: you@your\.isp
              * ! ^From:.*you@([-a-z0-9_]+\.)your\.suffix
              | (formail -r \
              -i"Subject: Sorry, Access Denied." \
              -A"Reply-To: you@your.isp" ; \
              echo "*************************************************" ; \
              echo "* This is a computer-generated response *" ; \
              echo "*************************************************" ; \
              echo ; \
              echo ; \
              echo " Greetings. I am the Mighty Guardian of YOUR mailbox, and "
; \
              echo " must temporarily bar your path." ; \
              echo ; \
              echo " Please include the one-time password ${PASSWD} anywhere on
the Subject line," ; \
              echo ; \
              echo " (you MUST use the password with the same address that you a
cquired it with)" ; \
              echo ; \
              echo " Then kindly re-send your email to your@your.isp" ; \
              echo ; \
              echo " If you wish to engage in regular correspondence, your " ; \
              echo " address(es) will be added to the priveleged list " ; \
              echo " and there will be no further muss or fuss." ; \
              echo ; \
              echo ; \
              echo ; \
              echo "************************************************" ; \
              echo "* THANK YOU ------- SPAM SUCKS *" ; \
              echo "************************************************" ; \
              echo ; \
              echo ; \
              echo ; \
              ) | $SENDMAIL -t && echo TSPW"$RANDOM" > ~/procmail/passfile

### Endnotes

# If the mail beats the above, send it to the ozone.

:0:
/dev/null

##############################################################################
This goes in your $PATH
#############################################################################

#!/bin/bash
# put on your path as recognized by procmail (see top of .procmailrc)
#procpass.sh

DIR=$HOME/procmail

nnt=`sed -n '/^Subject/s/\(^Sub.*\)\(TSPW[0-9][0-9]*\)\(.*\)/\2/p' $DIR/newmail`
tnn=`sed -n '/^From:/p' $DIR/newmail`
echo "$nnt $tnn" > $DIR/procpass2

tnt=`cat $DIR/procpass2`

cat $DIR/procpass | while read line; do if [ "$line" = "$tnt" ]
       then cat $DIR/newmail >> ~/Mail/inbox
            sed "/$line/d" $DIR/procpass > $DIR/procpass3
             mv $DIR/procpass3 $DIR/procpass
    else continue
  fi
done

#############################################################################
sedd1. personalize and make sure there are no spaces at the top or bottom
These two go in ~/procmail .These do not need to be executable
#############################################################################
/^### Priveleged/a\
\
\
:0 h\
* ^From.XXX\
* ! ^X-Loop: you@your.isp\
${DEFAULT}\
\
\
:0 h\
* ^Cc: XXX\
* ! ^Cc:.*@.*@\
* ! ^X-Loop: you@your.isp\
${DEFAULT}
##########################################################################
sedd2. same
#############################################################################
/^### Temp/a\
\
\
:0 h\
* ^From.XXX\
* ! ^X-Loop: you@your.isp\
${DEFAULT}\
\
\
:0 h\
* ^Cc: XXX\
* ! ^Cc:.*@.*@\
* ! ^X-Loop: you@your.isp\
${DEFAULT}
######################################################################
priv.sh goes in your $PATH
#####################################################################
#!/bin/bash
#priv.sh
clear
echo
echo
echo
echo
echo [1] Enter this to make an entry in the Priveleged List then
echo enter the new address at the prompt.
echo
echo [2] Enter this for the Temp Priveleged list.....
echo
echo
echo
echo

read num

case "$num" in

"1" ) mm=~/procmail/sedd1 ;;
"2" ) mm=~/procmail/sedd2 ;;

esac

read nn

sed "s/XXX/$nn/g" $mm > seddtemp ; mv seddtemp $mm

sed -f $mm ~/.procmailrc > seddtemp2 ; mv seddtemp2 ~/.procmailrc

sed "s/$nn/XXX/g" $mm > seddtemp3 ; mv seddtemp3 $mm

##########################################################################
# Send submissions for comp.os.linux.announce to: cola@stump.algebra.com #
# PLEASE remember a short description of the software and the LOCATION. #
# This group is archived at http://stump.algebra.com/~cola/ #
##########################################################################



Relevant Pages

  • PPM
    ... The scripts at the bottom and a couple ... The scripts priv.sh, sedd1 and sedd2 make adding these entries very simple. ... Just enough of the .procmailrc to make this work. ...
    (comp.os.linux.networking)
  • PPM
    ... The scripts at the bottom and a couple ... The scripts priv.sh, sedd1 and sedd2 make adding these entries very simple. ... Just enough of the .procmailrc to make this work. ...
    (alt.os.linux.suse)
  • PPM
    ... The scripts at the bottom and a couple ... The scripts priv.sh, sedd1 and sedd2 make adding these entries very simple. ... Just enough of the .procmailrc to make this work. ...
    (alt.os.linux.redhat)
  • PPM
    ... The scripts at the bottom and a couple ... The scripts priv.sh, sedd1 and sedd2 make adding these entries very simple. ... Just enough of the .procmailrc to make this work. ...
    (comp.os.linux.security)
  • Re: oSQL - How do I run all .SQL files in a folder by running one batch
    ... the scripts in the folder. ... ECHO Please specify a folder like this: ... you can get the batch file to do that for you: ...
    (microsoft.public.sqlserver.connect)