]> git.madduck.net Git - etc/mailfilter.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

deliver delayed/tickled mail as read
authormartin f. krafft <madduck@madduck.net>
Sun, 14 Sep 2008 11:26:32 +0000 (13:26 +0200)
committermartin f. krafft <madduck@madduck.net>
Sun, 14 Sep 2008 11:26:32 +0000 (13:26 +0200)
bin/resubmit
procmail/defines
procmail/tickle

index c51244b0a5a627f470bd796a565690b1a50ed747..62275843097bfa95836b998f5205019504c2a4a9 100755 (executable)
@@ -19,13 +19,15 @@ usage()
        -V|--version & show version information.
        -h|--help & show this output.
        -l|--list & process the argument list (even if empty), never stdin
        -V|--version & show version information.
        -h|--help & show this output.
        -l|--list & process the argument list (even if empty), never stdin
+       -r|--deliver-read & mark messages read on delivery
        _eof
 }
 
        _eof
 }
 
-SHORTOPTS=Vhl
-LONGOPTS=version,help,list
+SHORTOPTS=Vhlr
+LONGOPTS=version,help,list,deliver-read
 
 list=0
 
 list=0
+mark_read=0
 files=
 
 for opt in $(getopt -n $ME -o $SHORTOPTS -l $LONGOPTS -u -- "$@"); do
 files=
 
 for opt in $(getopt -n $ME -o $SHORTOPTS -l $LONGOPTS -u -- "$@"); do
@@ -33,6 +35,7 @@ for opt in $(getopt -n $ME -o $SHORTOPTS -l $LONGOPTS -u -- "$@"); do
     -V|--version) about; exit 0;;
     -h|--help) about; echo; usage; exit 0;;
     -l|--list) list=1;;
     -V|--version) about; exit 0;;
     -h|--help) about; echo; usage; exit 0;;
     -l|--list) list=1;;
+    -r|--deliver-read) mark_read=1;;
     --) :;;
     *)
       if [ -f "$opt" ] && [ -r "$opt" ]; then
     --) :;;
     *)
       if [ -f "$opt" ] && [ -r "$opt" ]; then
@@ -46,6 +49,11 @@ for opt in $(getopt -n $ME -o $SHORTOPTS -l $LONGOPTS -u -- "$@"); do
 done
 
 PROCMAIL=$HOME/.etc/mailfilter/procmail/procmailrc
 done
 
 PROCMAIL=$HOME/.etc/mailfilter/procmail/procmailrc
+
+if [ "$mark_read" -eq 1 ]; then
+  PROCMAIL="$PROCMAIL DELIVER_READ=1"
+fi
+
 # execute the date -R only during the eval, not immediately
 FILTER='/usr/bin/formail -I"X-Resubmitted: $(date -R)"'
 
 # execute the date -R only during the eval, not immediately
 FILTER='/usr/bin/formail -I"X-Resubmitted: $(date -R)"'
 
index e96e7f0208be00e56aae5352532bf2f7c0bf23dd..bdc31674b19ee61f2b9714881b9163b2f66603ad 100644 (file)
@@ -237,4 +237,9 @@ DELAY
 # released. Overrides DELAY.
 RELEASE
 
 # released. Overrides DELAY.
 RELEASE
 
+# MARK_READ
+# when set, causes mails to be marked as read when delivered. Can be
+# initialised with DELIVER_READ
+MARK_READ=$DELIVER_READ
+
 # vim:ft=procmail
 # vim:ft=procmail
index 503841072394506f86f6bb5e18e91f5d65a58c53..cc03d4a1c2813c815b8145abfcf0045d5f5de5ad 100644 (file)
@@ -59,6 +59,9 @@
   :0 fw
   |$FORMAIL -I"X-Tickle: $RELEASE"
 
   :0 fw
   |$FORMAIL -I"X-Tickle: $RELEASE"
 
+  # store messages as read
+  MARK_READ=true
+
   # unset DISABLE_DELAYS to always enable delaying for tickle messages
   DISABLE_DELAYS
 }
   # unset DISABLE_DELAYS to always enable delaying for tickle messages
   DISABLE_DELAYS
 }