Steffen Daode Nurpmeso <sdao...@googlemail.com> added the comment:

I'll attach a patch with a clearer comment (entry-gate instead
"new mail"), i.e. the comment now reflects what MUAs really do.

----------
Added file: http://bugs.python.org/file21850/11935.2.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11935>
_______________________________________
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -692,6 +692,13 @@
         self._file = open(self._path, 'rb+')
         self._toc = new_toc
         self._pending = False
+        # Set modification time to be after access time so that MMDF and MBOX
+        # mail readers detect changes (or perform further inspection to do so)
+        try:
+            currtime = time.time()
+            os.utime(self._path, (currtime-3, currtime))
+        except:
+            pass
         if self._locked:
             _lock_file(self._file, dotlock=False)
 
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to