Project

General

Profile

IMAP ignoring some messages

Added by Falcon Wood over 7 years ago

This is the situation:

Users send messages to IMAP server
IMAP Server receives messages OK. -> Message is in inbox unread
Rake task to check IMAP server logs in Ok.
Rake task, reads message Production version or Debug -> only error was 'message failed to expunge'. Leaves message in inbox.
Rake task marks message as read (can see by monitoring the IMAP account with a client. )
Ticket is not updated.

This happens about 5% of the time, sometimes it updates, sometimes not. I have tried allow_override=all and various combinations, no pattern has been identified as to why the messages are ignored. No debug or log provides an error other than 'message failed to expunge', but it will still process messages anyway.

Each time the message is reliably delivered to IMAP account inbox, and marked from unread -> read.
Each time expunge fails (this is not a HUGE issue). But sometimes it processes and sometimes not.

Interestingly when you re-mark the message as Unread, it will come back through and re-mark it as read, but still does not process the message, but there are no errors in cron_rake.log, production.log, unicorn.stderr.log, or unicorn_stdout.log

Any ideas as to how to get better visibility in this unicorn rake task?
root@74359e6cda5c:/home/redmine/redmine/bin# ./about

Environment:
  Redmine version                3.3.0.stable
  Ruby version                   2.1.9-p490 (2016-03-30) [x86_64-linux-gnu]
  Rails version                  4.2.6
  Environment                    production
  Database adapter               PostgreSQL
SCM:
  Subversion                     1.8.8
  Darcs                          2.8.4
  Mercurial                      2.8.2
  Cvs                            1.12.13
  Bazaar                         2.7.0
  Git                            2.9.2
  Filesystem
Redmine plugins:
  redmine_extended_watchers      1.0.5

Replies (4)

RE: IMAP ignoring some messages - Added by Falcon Wood over 7 years ago

How do I set up debug logging for this???

I added:
/usr/bin/rake -f /usr/share/redmine/Rakefile *--verbose* redmine:email:receive_imap RAILS_ENV="production" ....

To the rake task, no additional logging details...

I also edited the environment as follows

Rails.application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # Code is not reloaded between requests.
  config.cache_classes = true

  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both threaded web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = true

  # Full error reports are disabled and caching is turned on.
  config.consider_all_requests_local = false
  config.action_controller.perform_caching = true

  # Disable delivery errors
  config.action_mailer.raise_delivery_errors = true *#Changed to True*

  # No email in production log
  #config.action_mailer.logger = nil *#Commented this out*

  # Print deprecation notices to the Rails logger.
  config.active_support.deprecation = :log

  #I have no clue, here is what I tried, and I got some level of logging errors in the cron_rake.log about these in some form 
  #config.action_mailer.logger = Logger.new(STDOUT)  @#Error here this is not the command...@ 
  #config.action_mailer.logger = Logger.new(File.dirname(FILE) + "/../../log/#{RAILS_ENV}.log") @#This is not the command...@ 
  #config.action_mailer.logger = :debug @#This is not the command...@ 
  #config.action_mailer.logger.level = :debug @#This is not the command... does not work either@ 

  config.log_level = :debug #Does not output the IMAP cron_rake stuff I would like to see. Why is it crashing, what is it doing, gee great it ran, but it didn't do what I expect so that's nice, need more info... 

end

RE: IMAP ignoring some messages - Added by Michael K. about 3 years ago

We have a similar problem.
Some emails (small percentage of them) are beeing marked as READ but issue is not updated in Redmine.

In production.log there is nothing about that, no error, no warn, nothing.

RE: IMAP ignoring some messages - Added by C S about 3 years ago

I think, it is the same Problem as i reported: Defect #34574

RE: IMAP ignoring some messages - Added by Michael K. about 3 years ago

C S wrote:

I think, it is the same Problem as i reported: Defect #34574

it's similar but not the same, I answered in #34574
Thanks for the info :)

    (1-4/4)