<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -11,32 +11,17 @@ class LoggedMail
   property :mapping_id,    Integer, :index =&gt; true
   property :recipient,     String
   property :subject,       String
-  property :filename,      String
   property :created_at,    DateTime
   property :delivered_at,  DateTime
   property :error_message, String
 
   belongs_to :mapping
-  before :save do
-    if delivered_at &amp;&amp; filename
-      FileUtils.rm_rf raw_path if File.exist?(raw_path)
-      self.filename = nil
-    end
-  end
 
   def self.from(message)
-    logged = new(:filename =&gt; message.filename, :subject =&gt; message.subject)
+    logged = new(:subject =&gt; message.subject)
     if !block_given? || yield(logged)
       logged.save
     end
     logged
   end
-
-  def raw
-    @raw ||= (!filename.blank? &amp;&amp; File.exist?(raw_path)) ? IO.read(raw_path) : nil
-  end
-
-  def raw_path
-    @raw_path ||= self.class.log_path / filename
-  end
 end</diff>
      <filename>app/models/logged_mail.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'tempfile'
 
 # Wrapper around a TMail object
 class Message
-  attr_accessor :body, :filename
+  attr_accessor :body
   attr_reader :mail, :attachments
 
   class &lt;&lt; self
@@ -33,19 +33,14 @@ class Message
   end
 
   def self.receive(raw)
-    file = Tempfile.new(&quot;astrotrain-#{raw.size}&quot;)
-    file &lt;&lt; raw
-    receive_file file.path, raw
+    message = parse(raw)
+    Mapping.process(message)
+    message
   end
 
   def self.receive_file(path, raw = nil)
-    FileUtils.mkdir_p(LoggedMail.log_path)
-    raw            ||= IO.read(path)
-    filename         = File.basename(path)
-    message          = parse(raw)
-    message.filename = filename
-    FileUtils.mv path, LoggedMail.log_path / filename
-    Mapping.process(message)
+    message = receive IO.read(path)
+    FileUtils.rm_rf path
     message
   end
 </diff>
      <filename>app/models/message.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ dependency &quot;merb-slices&quot;, ver        # Provides a mechanism for letting plugins
 dependency &quot;merb-auth&quot;, ver          # An authentication slice (Merb's equivalent to Rails' restful authentication)
 dependency &quot;merb-param-protection&quot;, ver
  
-dm_ver = &quot;0.9.9&quot;
+dm_ver = &quot;0.9.10&quot;
 dependency &quot;dm-core&quot;, dm_ver         # The datamapper ORM
 dependency &quot;dm-aggregates&quot;, dm_ver   # Provides your DM models with count, sum, avg, min, max, etc.
 dependency &quot;dm-migrations&quot;, dm_ver   # Make incremental changes to your database.</diff>
      <filename>config/dependencies.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,24 +9,12 @@ describe LoggedMail do
       @mapping = @user.mappings.create!(:user_id =&gt; @user.id, :email_user =&gt; '*', :recipient_header_order =&gt; 'delivered_to,original_to,to')
       @raw     = mail(:custom)
       @message = Message.parse(@raw)
-      @message.filename = 'logged_mail_raw'
       @logged  = LoggedMail.from(@message) do |l|
         l.recipient = @message.recipients(%w(delivered_to)).first
         l.mapping   = @mapping
       end
     end
 
-    before do
-      File.open @logged.raw_path, 'w' do |f|
-        f &lt;&lt; @raw
-      end
-    end
-
-    it &quot;clears message file if no mapping was set&quot; do
-      Mapping.process(@message)
-      File.exist?(@logged.raw_path).should == false
-    end
-
     it &quot;sets recipient&quot; do
       @logged.recipient.should == @message.recipients(%w(delivered_to)).first
     end
@@ -38,20 +26,5 @@ describe LoggedMail do
     it &quot;sets mapping&quot; do
       @logged.mapping.should == @mapping
     end
-
-    it &quot;sets raw headers&quot; do
-      @logged.raw.should == @raw
-    end
-
-    it &quot;keeps raw file&quot; do
-      File.exist?(@logged.raw_path).should == true
-    end
-
-    it &quot;deletes raw file if delivered&quot; do
-      @logged.delivered_at = Time.now.utc
-      @logged.save
-      @logged.filename.should == nil
-      File.exist?(@logged.raw_path).should == false
-    end
   end
 end
\ No newline at end of file</diff>
      <filename>spec/models/logged_mail_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -66,10 +66,6 @@ describe Message do
           @log.mapping.should == @mapping
         end
 
-        it &quot;sets filename&quot; do
-          @log.filename.should == nil
-        end
-
         it &quot;sets subject&quot; do
           @log.subject.should == @msg.subject
         end</diff>
      <filename>spec/models/message_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5a47b06e825c44b6b7f337d5777b10b0077eed8a</id>
    </parent>
  </parents>
  <author>
    <name>rick</name>
    <email>technoweenie@gmail.com</email>
  </author>
  <url>http://github.com/jnunemaker/astrotrain/commit/0ebf9216782ec1d1d8ca66f230e68ece7f6016c2</url>
  <id>0ebf9216782ec1d1d8ca66f230e68ece7f6016c2</id>
  <committed-date>2009-04-19T19:44:29-07:00</committed-date>
  <authored-date>2009-03-17T14:53:14-07:00</authored-date>
  <message>dont log mails, assume they're archived elsewhere

Signed-off-by: John Nunemaker &lt;nunemaker@gmail.com&gt;</message>
  <tree>2cbd2ce67d52915845a86164329e95589fefa158</tree>
  <committer>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </committer>
</commit>
