Mercurial > hg > soundsoftware-site
comparison lib/redmine/pop3.rb @ 1115:433d4f72a19b redmine-2.2
Update to Redmine SVN revision 11137 on 2.2-stable branch
author | Chris Cannam |
---|---|
date | Mon, 07 Jan 2013 12:01:42 +0000 |
parents | cbb26bc654de |
children | 622f24f53b42 |
comparison
equal
deleted
inserted
replaced
929:5f33065ddc4b | 1115:433d4f72a19b |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2011 Jean-Philippe Lang | 2 # Copyright (C) 2006-2012 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
33 logger.debug "No email to process" if logger && logger.debug? | 33 logger.debug "No email to process" if logger && logger.debug? |
34 else | 34 else |
35 logger.debug "#{pop_session.mails.size} email(s) to process..." if logger && logger.debug? | 35 logger.debug "#{pop_session.mails.size} email(s) to process..." if logger && logger.debug? |
36 pop_session.each_mail do |msg| | 36 pop_session.each_mail do |msg| |
37 message = msg.pop | 37 message = msg.pop |
38 message_id = (message =~ /^Message-ID: (.*)/ ? $1 : '').strip | 38 message_id = (message =~ /^Message-I[dD]: (.*)/ ? $1 : '').strip |
39 if MailHandler.receive(message, options) | 39 if MailHandler.receive(message, options) |
40 msg.delete | 40 msg.delete |
41 logger.debug "--> Message #{message_id} processed and deleted from the server" if logger && logger.debug? | 41 logger.debug "--> Message #{message_id} processed and deleted from the server" if logger && logger.debug? |
42 else | 42 else |
43 if delete_unprocessed | 43 if delete_unprocessed |
53 end | 53 end |
54 | 54 |
55 private | 55 private |
56 | 56 |
57 def logger | 57 def logger |
58 RAILS_DEFAULT_LOGGER | 58 ::Rails.logger |
59 end | 59 end |
60 end | 60 end |
61 end | 61 end |
62 end | 62 end |