procmail
[Top] [All Lists]

Re: Matching the first occurrence of a header field

2002-04-07 13:03:22
On Sun, Apr 07, 2002 at 02:22:45PM -0500, David W. Tamkin wrote:
Philip suggested to Romildo,

| * ^Received:.*(^.*)*\/Received:.*

What if there is a header named something like X-Received: or
Divine-Revelation-Received: between the first two Received: headers?  What if
for some reason the string "Received:" appears later along in the first
Received: header?  The second Received: in that condition line needs to be
left-anchored to a newline.  You could work with $ instead of ^ as I
suggested,

 * ^Received:(.+$)+\/Received:.+

or modify Philip's form:

 * ^Received:.+(^.+)*^\/Received:.+

Thanks for all the clues.

Now I can correctly save the messages I fetch from
my university using fetchmail in a separte folder.
The first Receive header is from localhost by
darling.home.br (my computer) with ESMPT, and the
second Receive header is the one added by fetchmail,
from iceb3.iceb.ufop.br (my university server) by
localhost with POP3. If this info appears in any
other Receive header, the message is not the
one from my university. It may be, for instance,
a bounce of the original message.

Regards.

Romildo
-- 
Prof. José Romildo Malaquias               Departamento de Computação
http://iceb.ufop.br/~romildo       Universidade Federal de Ouro Preto
romildo(_at_)iceb(_dot_)ufop(_dot_)br                                           
Brasil
romildo(_at_)uber(_dot_)com(_dot_)br
_______________________________________________
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>