Permalink
Browse files

Revert previous change for POP3 stuff.

  • Loading branch information...
1 parent dae1d08 commit 176ab0c3c4abc58ac4a5f774fa53c228f5f08a53 @alexw668 alexw668 committed Mar 17, 2012
Showing with 8 additions and 16 deletions.
  1. +7 −13 lib/newman/mailer.rb
  2. +1 −3 lib/newman/settings.rb
View
@@ -33,15 +33,14 @@ class Mailer
def initialize(settings)
smtp = settings.smtp
+ imap = settings.imap
- self.use_pop3 = (settings.use_pop3.nil? || settings.pop3.nil?) ? false : settings.use_pop3
- mbox = self.use_pop3 ? settings.pop3 : settings.imap
self.retriever_settings = {
- :address => mbox.address,
- :user_name => mbox.user,
- :password => mbox.password,
- :enable_ssl => mbox.ssl_enabled || false,
- :port => mbox.port
+ :address => imap.address,
+ :user_name => imap.user,
+ :password => imap.password,
+ :enable_ssl => imap.ssl_enabled || false,
+ :port => imap.port
}
self.delivery_settings = {
@@ -62,11 +61,7 @@ def initialize(settings)
# an empty array otherwise.
def messages
- if self.use_pop3
- Mail::POP3.new(retriever_settings).all(:delete_after_find => true)
- else
- Mail::IMAP.new(retriever_settings).all(:delete_after_find => true)
- end
+ Mail::IMAP.new(retriever_settings).all(:delete_after_find => true)
end
# ---
@@ -94,7 +89,6 @@ def deliver_message(*a, &b)
new_message(*a, &b).deliver
end
- attr_accessor :use_pop3
# ---
# **NOTE: Methods below this point in the file are implementation
View
@@ -86,8 +86,6 @@ def self.from_file(filename)
def initialize
self.imap = OpenStruct.new
- self.pop3 = OpenStruct.new
- self.use_pop3 = false
self.smtp = OpenStruct.new
self.service = OpenStruct.new
self.application = OpenStruct.new
@@ -100,7 +98,7 @@ def initialize
# `Newman::Server`), and the `application` field is reserved for
# application-specific configurations.
- attr_accessor :imap, :pop3, :smtp, :service, :application, :use_pop3
+ attr_accessor :imap, :smtp, :service, :application
# ---

0 comments on commit 176ab0c

Please sign in to comment.