[CentOS] Logwatch for postfix

Tue Oct 2 10:52:12 UTC 2007
Stephen Harris <lists at spuddy.org>

On Tue, Oct 02, 2007 at 12:41:28PM +0200, Morten Torstensen wrote:
> On CentOS5 with the latest updates applied, the logwatch filter for 
> postfix returns way too many lines from the log. I get an "unmatched 
> entries" message and all messages that have gone through the system is 
> listed.

Yeah.  My fix was to copy the services/postfix file in to
  /etc/logwatch/scripts/services/postfix
and edit the file.

The big issue is that postfix changed it's log format so the logwatch entries
didn't match.  I think the main change I made was to change all versions of
"delay" to read
  delay=-?[0-9\.]+,.*

Here is a diff that seems to work for me

begin 644 pf.fix
M*BHJ("]U<W(O<VAA<F4O;&]G=V%T8V at O<V-R:7!T<R]S97)V:6-E<R]P;W-T
M9FEX"5-A="!*86X@(#8@,#DZ,#@Z,C(@,C`P-PHM+2T at +V5T8R]L;V=W871C
M:"]S8W)I<'1S+W-E<G9I8V5S+W!O<W1F:7@)1G)I($%U9R`S,2`R,3HQ-#HP
M,B`R,#`W"BHJ*BHJ*BHJ*BHJ*BHJ*@HJ*BH@,38T+#$W,"`J*BHJ"B`@("`@
M("`@*"`D5&AI<TQI;F4@/7X@;2]>6V$M>D$M6C`M.5TK.B!C;&EE;G0]*%M>
M(%TJ7%M;7B!=*EQ=*5QS*B0O("D@;W(@"B`@("`@("`@*"`D5&AI<TQI;F4@
M/7X@;2]>6V$M>D$M6C`M.5TK.B!M97-S86=E+6ED+R`I(&]R"B`@("`@("`@
M*"`D5&AI<TQI;F4@/7X@;2]>6V$M>D$M6C`M.5TK.B!S:VEP<&5D+"!S=&EL
M;"!B96EN9R!D96QI=F5R960O("D@;W(*(2`@("`@("`H("14:&ES3&EN92`]
M?B!M+UY;82UZ02U:,"TY72LZ('1O/5P\+BH^+"!R96QA>3TN*BP at 9&5L87D]
M6S`M.5TK+"!S=&%T=7,]*'-E;G1\9&5F97)R960I+R`I(&]R"B`@("`@("`@
M*"`D5&AI<TQI;F4@/7X@;2]>6V$M>D$M6C`M.5TK.B!H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*BHJ*BHJ"BHJ*B`R,S(L,C,X("HJ*BH*("`@
M("`@("`@("`D5&5M<"`](")4;R`B("X@)$1E<W0 at +B`B($US9SU<(B(@+B`D
M37-G("X@(EPB(CL*("`@("`@("`@("`D1F]R96EG;D)O=6YC97LD5&5M<'TK
M*SL*("`@("`@("!]"B$@("`@?2!E;'-I9B`H("@D4F5L87DL)$1E<W0I(#T@
M*"14:&ES3&EN92`]?B!M+W)E:F5C=#H at 4D-05"!F<F]M("A;7B!=*BDZ(%LP
M+3E=*R`\*%M>(%TJ*3XN*B!296QA>2!A8V-E<W, at 9&5N:65D+BH@=&\]*%M>
M(%TJ*2\I("D@>PH@("`@("`@(",@<')I;G0@(G)E:F5C=#H@(B`N("14:&ES
M3&EN92`N(")<;B(["B`@("`@("`@(R!P<FEN="`B4F5L87D at .B(@+B`D4F5L
M87D at +B`B('1O("(@+B`D1&5S="`N(")<;B(["B`@("`@("`@)%1E;7`@/2`B
M1G)O;2`B("X@)%)E;&%Y("X@(B!T;R`B("X@)$1E<W0["BTM+2`R,S(L,C,X
M("TM+2T*("`@("`@("`@("`D5&5M<"`](")4;R`B("X@)$1E<W0 at +B`B($US
M9SU<(B(@+B`D37-G("X@(EPB(CL*("`@("`@("`@("`D1F]R96EG;D)O=6YC
M97LD5&5M<'TK*SL*("`@("`@("!]"B$@("`@?2!E;'-I9B`H("@D4F5L87DL
M)$1E<W0I(#T@*"14:&ES3&EN92`]?B!M+W)E:F5C=#H at 4D-05"!F<F]M("A;
M7B!=*BDZ(%LP+3E<+B!=*R`\*%M>(%TJ*3XN*B!296QA>2!A8V-E<W, at 9&5N
M:65D+BH@=&\]*%M>(%TJ*2\I("D@>PH@("`@("`@(",@<')I;G0@(G)E:F5C
M=#H@(B`N("14:&ES3&EN92`N(")<;B(["B`@("`@("`@(R!P<FEN="`B4F5L
M87D at .B(@+B`D4F5L87D at +B`B('1O("(@+B`D1&5S="`N(")<;B(["B`@("`@
M("`@)%1E;7`@/2`B1G)O;2`B("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