bergman on 20 Jan 2006 16:08:08 -0000

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] procmail and matching on split lines

In the message dated: Fri, 20 Jan 2006 08:31:58 EST,
The pithy ruminations from Jeff Abrahamson on 
<[PLUG] procmail and matching on split lines> were:

=> I have a procmail rule that guarantees I don't miss mailman notices
=> that I have to approve:
=>     :0:
=>     * ^Subject: .*post.*requires approval
=>     /var/mail/$LOGNAME
=> It turns out that a very long email address can foil this:
=>     Date: Fri, 20 Jan 2006 00:12:19 -0500
=>     From:
=>     Subject: Cs260-200502 post from requires
=> 	    approval
=>     To:
=> I didn't realize subject lines could contain hard breaks.  I'm not

I believe that the "broken" line (with the initial whitespace) was inserted
by the MUA, not the user. In mail-speak, it's a continued line, and is treated 
as part of the precceding line...except that line-oriented utilities like 
procmail don't know that.

=> sure how to match this without matching anything containing "post" and
=> "requires".  Indeed, an even longer email address could push
=> "requires" to the next line, and I'm not clear how to match that.
=> I think this would work, but feels overly broad:
=>     :0:
=>     * ^Subject: .*post
=>     * ^.*requires
=>     * ^.*approval$
=>     /var/mail/$LOGNAME
=> Any suggestions for doing better?

There's a tool that's specific to this job...formail. Check out the "-c" 
(concatenate) option.

Mark Bergman
Seeking a Unix/Linux sysadmin position local to Philadelphia or via telecommuting

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --