procmail
[Top] [All Lists]

Re: wit's end: .procmail woes

2004-04-14 10:22:19
*deep breath* Sorry.  Let me start over...


machine 1: (Solaris 9)
This machine is both the initial recipient for all of my email, and the
final recipient.  So, I want to put all of the filtered mail in either
a spam filefolder in the case of spam, or in my default filefolder or
maybe mail/gabe.  both mail/spam and mail/gabe are read/writable files.
spam should be labelled BMISPAM
all other filtered mail should be labelled GABEFILTERED

LOGFILE=$HOME/procmaillog
VERBOSE=ON

# Originally I lifted this off a .procmail tips page which explained
# how to prepend a subject header.  I had wanted to remove the labels from
# my mail when it came back in to machine 1 after had been filtered on
# machine 2, but I abandoned that idea and just tried to get the loop to
# work.
#SUBJ_=`formail -xSubject: \
#        | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`

:0:
* ^Subject:  BMISPAM
mail/spambmi

:0:
* ^Subject: GABEFILTERED
mail/gabe

# This recipe works fine when the forwarding part of machine 2's
# .procmailrc is off, and vice versa.  But when both are uncommented
# mail doesn't appear anywhere
#:0
#!gabe(_at_)gabelaw(_dot_)org

Do you know that the subjects are prefixed with
a SINGLE space, or might there be multiple, or a tab?

I only care about the filtered mail, which should just have a single
space.

machine 2: (Redhat 8)
This is my filtering machine.  It takes all email directed to it, filters
it, labels the spam as such (BMISPAM) and let's it continue. This is where
gabe(_at_)gabelaw(_dot_)org's .procmailrc comes in.

This doesn't tinker with tab conversions in t he MIDDLE of the string, but
leading and trailing will have been dealt with.  Do you have a BROKEN MUA
that necessitates the tab conversion?

No, I just stole someone else's.  You're right it's totally unnecessary!

# Try this cleaned up version:
LOGFILE=$HOME/procmaillog
VERBOSE=ON

# Get the subject discarding any leading and trailing blanks
# if you REALLY need to replace tabs with spaces, you can still pipe to expand
SUBJ_=`formail -zxSubject:`

:0
* ! SUBJ_ ?? ^ BMISPAM
{
         # This would not be set if this filter doesn't trigger.
         GABEOTRONIC="GABEFILTERED "
}

# rewrite the Subject header anyway (since we may have stripped spaces)
:0 fwh
| formail -i"Subject: ${GABEOTRONIC}${SUBJ_}"

# This works when the forwarding part of machine 1's .procmailrc is turned
# off
:0
!glaw(_at_)eecs(_dot_)tufts(_dot_)edu



-------------------------------------------------
So, again, even with Sean's vastly cleaner version it still doesn't work.
Removing one forwarding line or another creates a working, albeit
incomplete loop.  Using both in conjunction results in email not appearing
anywhere.

Any help or suggestions would be greatly appreciated.  (Going back to peer
over logs)



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>