#!/bin/bash # inotifywait --event modify ~/mail/zzlore # MBOX=$HOME/mail/zzlore cat $MBOX \ | formail +1 -x Message-id: -s \ | perl -pe 's/.*.*//' \ | while read msgid; do ~/bin/intel/intel-browser-launcher https://lore.kernel.org/r/$msgid; done # truncate the messages out of the mbox: TMP=$(mktemp /tmp/lore-msgic-opener-XXXXXXXX) cat "$MBOX" | formail -1 -s > "$TMP" mv "$TMP" "$MBOX"