You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Benny Pedersen <me...@junc.eu> on 2018/02/28 20:01:36 UTC

how to grep multiline add-header X-Spam lines

how do one make multiline grep of add-header line, this is imho triggy 
since it on long lines continue on next line with a first char space, if 
one could help me solve it i be thankfull

Re: how to grep multiline add-header X-Spam lines

Posted by Martin Gregorie <ma...@gregorie.org>.
On Wed, 2018-02-28 at 21:01 +0100, Benny Pedersen wrote:
> how do one make multiline grep of add-header line, this is imho
> triggy since it on long lines continue on next line with a first char
> space, if one could help me solve it i be thankfull
>
I don't know an direct fix, but you could using the -C (context) option
might help:

grep -C 3 'regexp' /var/log/maillog*  

will show lines matching the regexp as well as the three lines before
and after it - seven lines in all.

Martin


Re: how to grep multiline add-header X-Spam lines

Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 28 Feb 2018, at 16:13 (-0500), RW wrote:

> On Wed, 28 Feb 2018 21:01:36 +0100
> Benny Pedersen wrote:
>
>> how do one make multiline grep of add-header line, this is imho
>> triggy since it on long lines continue on next line with a first char
>> space, if one could help me solve it i be thankfull
>
> If you want to use grep, you can pipe the files through an awk
> one-liner to unfold the headers.

That works, but it is probably more convenient (if one has the procmail 
package installed or can install it easily and doesn't have awk syntax 
in the wetware) to use formmail -cs


-- 
Bill Cole
bill@scconsult.com or billcole@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Currently Seeking Steady Work: https://linkedin.com/in/billcole

Re: how to grep multiline add-header X-Spam lines

Posted by RW <rw...@googlemail.com>.
On Wed, 28 Feb 2018 21:01:36 +0100
Benny Pedersen wrote:

> how do one make multiline grep of add-header line, this is imho
> triggy since it on long lines continue on next line with a first char
> space, if one could help me solve it i be thankfull

If you want to use grep, you can pipe the files through an awk
one-liner to unfold the headers.