Methods
C
D
E
I
N
R
U
Constants
PORT_CLASS = MaildirPort
 
TOO_OLD = 60 * 60 * 36
 
Class Public methods
new( dir = nil )
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 329
def initialize( dir = nil )
  @dirname = dir || ENV['MAILDIR']
  raise ArgumentError, "not directory: #{@dirname}"                               unless FileTest.directory? @dirname
  @new = "#{@dirname}/new"
  @tmp = "#{@dirname}/tmp"
  @cur = "#{@dirname}/cur"
end
unique_number()
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 322
def Maildir.unique_number
  synchronize {
      @seq += 1
      return @seq
  }
end
Instance Public methods
check_tmp()
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 399
def check_tmp
  old = Time.now.to_i - TOO_OLD
  
  each_filename(@tmp) do |full, fname|
    if FileTest.file? full and
       File.stat(full).mtime.to_i < old
      File.unlink full
    end
  end
end
close()
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 346
def close
end
directory()
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 338
def directory
  @dirname
end
each()
each_mail()
each_new_port()
Also aliased as: each_newmail
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 387
def each_new_port
  mail_files(@new).each do |path|
    dest = @cur + '/' + File.basename(path)
    File.rename path, dest
    yield PORT_CLASS.new(dest)
  end

  check_tmp
end
each_newmail()
each_port()
Also aliased as: each, each_mail
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 349
def each_port
  mail_files(@cur).each do |path|
    yield PORT_CLASS.new(path)
  end
end
inspect()
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 342
def inspect
  "#<#{self.class} #{@dirname}>"
end
new_mail()
new_port()
Also aliased as: new_mail
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 365
def new_port
  fname = nil
  tmpfname = nil
  newfname = nil

  begin
    fname = "#{Time.now.to_i}.#{$$}_#{Maildir.unique_number}.#{Socket.gethostname}"
    
    tmpfname = "#{@tmp}/#{fname}"
    newfname = "#{@new}/#{fname}"
  end while FileTest.exist? tmpfname

  if block_given?
    File.open(tmpfname, 'w') {|f| yield f }
    File.rename tmpfname, newfname
    PORT_CLASS.new(newfname)
  else
    File.open(tmpfname, 'w') {|f| f.write "\n\n" }
    PORT_CLASS.new(tmpfname)
  end
end
reverse_each()
reverse_each_port()
Also aliased as: reverse_each
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 357
def reverse_each_port
  mail_files(@cur).reverse_each do |path|
    yield PORT_CLASS.new(path)
  end
end