On Tue, Dec 13, 2016 at 03:23:43PM +0100, Neels Hofmeyr wrote:
> I also thought about a grep + rm shell script working on my maildir files
> :P

I have in fact solved my problem locally now, so I won't press this from
my side anymore, though I'd be +1 for reducing the mails for everyone.

In maildir where each mail is in a separate file:

  move_to_dropped() {
    while read f; do
      # make sure jenkins is the sender
      if [ -n "$(grep '^From: Jenkins Builder 
<[email protected]>$' "$f")" ]; then
        echo mv "$f" "$dropped_dir"
        mv "$f" "$dropped_dir"
      fi
    done
  }

  rgrep -l '^Build Started http://jenkins.osmocom.org/jenkins/job' "$inbox" | 
move_to_dropped
  rgrep -l '^Build Successful $' "$inbox" | move_to_dropped


~N

Attachment: signature.asc
Description: Digital signature

Reply via email to