]> git.madduck.net Git - etc/mailfilter.git/blobdiff - bin/process-tickler

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:

replace existing x-tickle-delivered header
[etc/mailfilter.git] / bin / process-tickler
index 0c3839ff025d7d39bc26d072ce5d4e126a7c542d..d7af9b6cd040a04eaf897e4051bec3180cc56cd1 100755 (executable)
@@ -24,7 +24,10 @@ msgids = dict()
 def move_to_inbox(key):
     msg = tmd.get_message(key)
     print >>sys.stdout, 'I: move message %s to inbox' % key
 def move_to_inbox(key):
     msg = tmd.get_message(key)
     print >>sys.stdout, 'I: move message %s to inbox' % key
-    msg.add_header('X-Tickle-Delivered', time.strftime('%c'))
+    if msg.has_key('X-Tickle-Delivered'):
+        msg.replace_header('X-Tickle-Delivered', time.strftime('%c'))
+    else:
+        msg.add_header('X-Tickle-Delivered', time.strftime('%c'))
     imd.add(msg)
     tmd.discard(key)
 
     imd.add(msg)
     tmd.discard(key)