]> git.cworth.org Git - sup/commitdiff
modulo the file size in a maildir, so it's <= 7 digits.
authorJeff Balogh <its.jeff.balogh@gmail.com>
Fri, 18 Jan 2008 08:58:33 +0000 (03:58 -0500)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 22 Jan 2008 03:03:11 +0000 (19:03 -0800)
The size needs to be <= 7 digits to preserve sup's increasing id
requirement.  Otherwise, large messages (probably w/ attachments) have
an id that is a magnitude larger than small messages.

lib/sup/maildir.rb

index ba9da001bc60cfbb9537578378e380d7999ea7d4..7b85383a8b15d694d1651195b81e473435fe7282 100644 (file)
@@ -144,7 +144,7 @@ private
 
   def make_id fn
     # use 7 digits for the size. why 7? seems nice.
-    sprintf("%d%07d", File.mtime(fn), File.size(fn)).to_i
+    sprintf("%d%07d", File.mtime(fn), File.size(fn) % 10000000).to_i
   end
 
   def with_file_for id