procmail
[Top] [All Lists]

Re: The recipe didn't do what they said it would do....

1997-06-05 08:08:00

Do you have some particular reason for not sending your question to the
list?

Didn't want to use too much bandwidth with what is probably just
newbie confusion.  The results of this first attempt make me realize
I need to thoroughly understand a recipe before trying it.  I picked up
procmail because I get lots of legitimate mail AND lots of spam.
The latter interferes with my work.  Nothing would be accomplished
(at least from my employer's point of view) if trial-and-error
procmail fumbling provides just as much interference.  And if
someone else gets involved in my fumbling, I didn't want to force
the rest of the list to listen :-)

(preference in answering questions given to those who include literal
chunks of .procmailrc and verbose logfile output)

OK, the following is no longer my .procmailrc  :-)

PATH=/bin:/usr/bin:/usr/home/wwgrol/bin
MAILDIR=$HOME/Mail           #you'd better make sure it exists
DEFAULT=$MAILDIR/mbox        #completely optional
LOGFILE=$MAILDIR/Log_File    #recommended
LOGABSTRACT=no

:0:
* ^From.*wwgrol
from_me

:0 c
backup

:0 ic
| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,32d`



# ____________________________________Trap info for the log
TRAP='formail -XTo: -XSubject: -XCc: -XFrom: -XDate:  \
-XReply-To:  -XReceived: -XX-Mailing -XTag: -XX-Loop: \
-XApparently- -XX-Envelope- -IResent-Bcc:           ; \
echo __________________________________________
'


# ____________________________________Bounce anything large
:0
* >10000

{
:0hfw # with `h' flag, no -k option for formail
* >10000
| formail -r -i "Subject: Mail Delivery Refused - Too Large"

:0bfwi
* >10000

  | echo "* Following mail apparently exceeds size limits.    *"  ; \
    echo "* - If it is not from you, then someone's forging   *"  ; \
    echo "*   your address, and I will be glad to help you    *"  ; \
    echo "*   catch him/her if you SAVE this message and send *"  ; \
    echo "*   me another smaller one to discuss the problem.  *"  ; \
    echo "* - If it is legitimate, contact me for delivery    *"  ; \
    echo "*   instructions.  (email is OK for that purpose)   *"  ; \
    echo "* - If it's 'spam', this message is way too polite! *"  ; \
    echo "   "                                                    ; \
    echo " ------- Undelivered message follows --------------- "  ; \
    cat -  

:0
! -oi -t
}

# Anything not yet matched goes directly to mailtool (or whatever).
# <END OF FILE>

The symptoms: Installed this, then went to get some one else to 
send me something large.  (I don't have another account myself.)

Interrupted on the way.  When I got back, my mail spool had NO new
messages.  But ~/Mail contained the following files:
.mailog   Log_File   backup   from_me   from
(I think there were one or two others.)  All had lots of mail
messages in them, except two which had only headers.  All had
different lengths, different first messages, and different last
messages.  The "big one" was not in any of them but neither did
it bounce to the sender (as far as I could tell).

Nowhere could I find the error log, though there should have been one,
because--with backup a file instead of a directory--the second
recipe (cd & rm) must fail.

Since yesterday's message, I've read more of the documentation,
and I no longer think the big-mail recipe is right, though I'm
not sure what is.

What is desired is:

Given one message that is huge, send back ONE message containing
(in order):
  my outgoing header
  the 'echo' text
  the incoming header (possibly with some of the Received lines removed--
                       no sense telling the spammer how our hosts are
                       connected internally)
  the incoming body

(An aside to an already too long message:  How do you make Sun's
OpenWindows mailtool append a .signature file?)