procmail
[Top] [All Lists]

Re: To = From

1999-02-19 07:51:55
Hi thanks for the quick way to the below :)
Not very clued up with procmail, just tried to get something to work and
once it works leave it there untill I need something more complicated sort
of a thing.

The problem is that I didn't give the correct solution to the question, so
I am resending the correct solution :) really sorry though!

If the from field contains notificaton send the message to lara, I haven't
escaped the body so the subject will be sent through.

Guarenteed that this will probably be shorted, but I'm not the expert you
guys are !



:0 Hc
* ^From.*notification.*
* !FROM_DAEMON
| (echo "To: lara(_at_)mighty(_dot_)co(_dot_)za"; echo "From: 
lara(_at_)mighty(_dot_)co(_dot_)za"; formail -r
-u TO) | /var/qmail/bin/qmail-inject -flara(_at_)mighty(_dot_)co(_dot_)za



lara


At 01:31 PM 2/19/99 +0200, you wrote:
On Thu, 18 Feb 1999 17:49:52 +0100, Christer Borang
<mort(_at_)dtek(_dot_)chalmers(_dot_)se> wrote:
In message 
<Pine(_dot_)LNX(_dot_)3(_dot_)96(_dot_)990218093112(_dot_)6773A-100000(_at_)argo(_dot_)dancris(_dot_)com>,
Michael Rawls writes:
possible for me to have procmail determine if the "To:" address and the
"From:" address are the same?
:0 h
SPAM_FROM=| formail -z -x 'From:'
:0 h
SPAM_TO=| formail -z -x 'To:'
# Is From: and To: identical?
:0 w
* ? test "$SPAM_FROM" = "$SPAM_TO"
* !^TOchalmers.se
xmail/SPAM/.

The call to test seems a little bit superfluous. You can do pretty
much the same completely in Procmail, although this solution (which is
straight out of my procmail/spam.rc) is not quite as general
(specifically, it just looks for completely identical fields --
ignoring any trailing fluff, which in principle is not a good idea--,
not the actual stripped addresses being equal):

   :0
   * ! ^FROM_DAEMON
   * ^To: \/.+
   * $ ^\/(From|Reply-To): $\MATCH
   { REJECT="$REJECT${REJECT:+$NL}${REJ}To: equals $MATCH" }

If you don't want to check for Reply-To being equal to To:, just take
that out. 

And note that many MAILER_DAEMON bounce messages are addressed to the
local postmaster, so I try to exclude them. Christer's suggestion to
exclude messages which are also addressed to yourself (or, in his
example, to his domain) seems like a better solution, though, but I
haven't tested it in practice yet.

/* era */

-- 
.obBotBait: It shouldn't even matter whether    <http://www.iki.fi/~era/>
I am a resident of the state of Washington.
<http://members.xoom.com/procmail/>

________________________________________________________________________

Lara Marques                                    
mailto:lara(_at_)mailgate(_dot_)net
Software Developer                                 work: +27 11 402 4116
                                                    fax: +27 11 402 4118
http://www.mighty.co.za                           cellular: 082 656 4665 
________________________________________________________________________        
                



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