remailback

send email reminders after a time period
git clone https://a3nm.net/git/remailback/
Log | Files | Refs

show.sh (724B)


      1 #!/bin/bash
      2 
      3 # Show all reminders about a message.
      4 # Usage: cat message | ./delet.sh
      5 
      6 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
      7 cd "$DIR"
      8 
      9 TEMPFILE=$(mktemp)
     10 cat > $TEMPFILE
     11 
     12 # get_email_header command from https://a3nm.net/git/mybin
     13 
     14 MESSAGEID=$(~/bin/get_email_header message-id < "$TEMPFILE")
     15 
     16 rm -f "$TEMPFILE"
     17 
     18 echo "Reminders for $MESSAGEID:"
     19 echo "SELECT * FROM reminders WHERE messageid='$MESSAGEID'" |
     20   sqlite3 remailback.sqlite | while read l; do 
     21   ID=$(echo "$l" | cut -d\| -f1)
     22   TTIME=$(echo "$l" | cut -d\| -f2)
     23   TDATE=$(date -d "@$TTIME")
     24   EXPL=$(echo "$l" | cut -d\| -f6)
     25   STATUS=$(echo "$l" | cut -d\| -f7)
     26   echo "Reminder $ID on $TDATE (status '$STATUS'): $EXPL"
     27 done
     28 
     29