Permalink
Browse files

Ensure delete bad email.

  • Loading branch information...
1 parent c0e0de9 commit 908ae446025b2e4c62008097c7e90894373155c4 @seven1m seven1m committed Jun 19, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 script/inbox
View
@@ -50,12 +50,13 @@ Net::POP3.start(host, nil, username, password) do |pop|
begin
logger.info "receiving mail..."
Notifier.receive(email.pop)
- email.delete
rescue Exception => e
logger.error "Error receiving email at " + Time.now.to_s + "::: " + e.message + "\n----\n" + e.backtrace.to_s
backtrace = e.backtrace.is_a?(Array) ? e.backtrace.join("\n") : e.backtrace.to_s
logger.error(backtrace)
Notifier.simple_message(Setting.get(:contact, :bug_notification_email), '[OneBody] Email Error', e.message + "\n\n" + backtrace).deliver
+ ensure
+ email.delete
end
end
logger.info "Finished Mail Importer."

0 comments on commit 908ae44

Please sign in to comment.