I'm trying to fetch e-mails into Redmine via IMAP.

The e-mails I'm generating look like this:

FooBar Ltd 

Project: backend
Tracker: Dataerror

This is the description

HTTP_USER_AGENT: mozilla/asdfjköl

I try to fetch them into Redmine via this command:

rake -f /var/www/projects/redmine/Rakefile redmine:email:receive_imap \
RAILS_ENV="production" host=example.com port=993 ssl=true username=redmine \
password=1234 project=myproject tracker=other \
allow_override=project,tracker,category,priority \
move_on_success=read move_on_failure=failed

But the e-mails get moved into the failed folder.

I had this setup running some time ago with a different e-mail generator but pretty much the same template, and I can't figure out why it's not working. The permissions seem to be OK too.

In order to further debug this issue, I need some logfiles. Are there any logfiles written by this command? Or are there any other suggestions to solve this issue?

My environment:

RAILS_ENV=production script/about
About your application's environment
Ruby version              1.8.7 (i486-linux)
RubyGems version          1.3.5
Rack version              1.0
Rails version             2.3.5
Active Record version     2.3.5
Active Resource version   2.3.5
Action Mailer version     2.3.5
Active Support version    2.3.5
Application root          /var/www/projects/redmine
Environment               production
Database adapter          mysql
Database schema version   20100819172912
  • If something interesting shows up with rake --trace, please post it.
    – harrymc
    Apr 7, 2011 at 19:14
  • @harrymc: Nothing special, no errors. The fetching works without problems, it's just the parsing that seems to fail. And there is no output about the reasons for the failing. Apr 8, 2011 at 8:43
  • You could try taking off values from allow_override. IMO this is the only parameter that can cause email to fail.
    – harrymc
    Apr 8, 2011 at 9:48
  • And have you looked at production.log?
    – harrymc
    Apr 8, 2011 at 9:56
  • @harrymc: Yes I have, nothing in there about IMAP. And even when removing the overrides parameter entirely, they all fail. Apr 8, 2011 at 11:08

3 Answers 3


From rake redmine:email:receive_imap does not receive mails :

In the model issue.rb there is a code

validates_presence_of :subject, :description, :priority, :project, :tracker, :author, :status

which says that priority is mandatory field. So i cannot create issue without receiving the value for priority parameter.

I am not a user of rake and do not have your environment, but you could check if you have some validation rule somewhere that causes email to fail. From your example, you only have project and tracker in the email, so requiring more will cause it to fail.

  • No I tried many combinations, with or without parameters. I also tried providing a default priority value. No change. Apr 13, 2011 at 13:33
  • The article mentioned rules that are built-into the rake environment and are found in files with an ".rb" suffix. Try to search for all "*.rb" files on your computer. If you find some, see if something in their content rings a bell, especially a "validates_presence_of :" line.
    – harrymc
    Apr 13, 2011 at 14:27
  • Well, Redmine documents their required and optional values. And even when using exactly the rake commands from their examples, it does not work. Apr 13, 2011 at 15:26
  • It may work in their environment, with their ".rb" file.
    – harrymc
    Apr 13, 2011 at 15:59

You could also try unknown_user=accept no-permission-check=1 based on: http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails#Enabling-unknown-users-to-create-issues-by-email

For more help, see your Redmine: lib/tasks/email.rake and lib/redmine/imap.rb


After quite a lot of finagling, I figured out that in my case, the problem was that my project name had a space in it. I was quoting the name (project="My Project"), but the code just silently failed. When I replaced the project name with the fixed single-token name (project="my_project"). It worked.

The most frustrating thing for me was not having sufficient diagnostic feedback.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.