You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2015/12/13 16:14:51 UTC

[whimsy.git] [7/37] Commit a808294: remove obsolete file

Commit a808294791ca138ce87cfbd35fadab32f3183ef2:
    remove obsolete file


Branch: refs/heads/secmail
Author: Sam Ruby <ru...@intertwingly.net>
Committer: Sam Ruby <ru...@intertwingly.net>
Pusher: rubys <ru...@apache.org>

------------------------------------------------------------
common.rb                                                    |  ----------
------------------------------------------------------------
37 changes: 0 additions, 37 deletions.
------------------------------------------------------------


diff --git a/common.rb b/common.rb
deleted file mode 100644
index 658126c..0000000
--- a/common.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'digest'
-require 'zlib'
-require 'zip'
-require 'stringio'
-
-require_relative 'config.rb'
-
-#
-# What to use as a hash for mail
-#
-def hashmail(message)
-  Digest::SHA1.hexdigest(mail[/^Message-ID:.*/i] || mail)[0..9]
-end
-
-#
-# Read a mailbox and split it into messages
-#
-def readmbox(filename)
-  mails = File.read(filename)
-
-  if filename.end_with? '.gz'
-    stream = StringIO.new(mails)
-    reader = Zlib::GzipReader.new(stream)
-    mails = reader.read
-    reader.close
-    stream.close rescue nil
-  end
-
-  mails.force_encoding Encoding::ASCII_8BIT
-
-  # split into individual messages
-  mails = mails.split(/^From .*/)
-  mails.shift
-
-  mails
-end
-