On Tuesday 24 February 2009, Karsten Bräckelmann wrote:
>On Tue, 2009-02-24 at 01:08 -0500, Gene Heskett wrote:
>> On Tuesday 24 February 2009, SM wrote:
>> > You could add a rule to catch the "no To-header" comment.
>>
>> Humm, if it can't find the unlisted stuff in the same line...
>
>There is no line break. Just as I suspected yesterday, I still suspect
>your copy-n-paste method to have inserted the newline. Procmail works
>with the raw message and doesn't look at the rendered KMail display.
>
>Btw, procmail concatenates multi-line headers and handles it
>transparently for you anyway.
>
>> Would this work?
>>
>> :0:
>>
>> *^*no To-header on input*
>> /dev/null
>
>Nope, it wouldn't. Procmail uses REs, not shell-style globbing.
>
I never claimed to understand regex's.  I know the ^ anchors the start of the 
search to the start of the line, and that the first * is needed to into a 
recipe, but how does one go about allowing it to search the whole line for 
the given character sequence, triggering on finding it at some arbitrary 
location in that line?  If grep can do it, why can't procmail?

IMO the Docs suck a deep space quality vacuum in re these details.  If there 
exists a decent tut on this subject, please point me at it.

>If you don't want to anchor your condition REs at the beginning of the
>line, don't. IMHO you'd better do though, for multiple reasons -- speed,
>and not to match any arbitrary header but the To header only.

Are you saying that if I remove the ^ and second *, then it will search the 
whole header?  Testing that now...

>That said, I do agree with Martin and John. The absence of a real
>recipient in the To header is NOT sufficient to silently discard mail.
>Even more so, since the POP3 server appears to have rewritten that
>stuff.

If I was an ISP, maybe.  But I'm just sick of junk mail & if I miss a free 
offer for 20 boxes of viagra, well... :)

Thanks.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
You will be a winner today.  Pick a fight with a four-year-old.

Reply via email to