Project

General

Profile

retreive_imap task not working --wrong number of arguments (2 for 1) error

Added by David Jurick over 15 years ago

I've finally decided to seek help on the Redmine forums after struggling with this problem for 5 or 6 hours. I've searched all over Google, the Redmine forums, and all of the documentation about receiving emails with Redmine(http://www.redmine.org/wiki/redmine/RedmineReceivingEmails?version=1)(http://www.redmine.org/wiki/1/RedmineReceivingEmails). Unfortunately, I haven't found anything that solved my problem. Here are the details of the problems:

I'm trying to set up our Redmine to retrieve emails from the inbox of an IMAP server. Redmine was installed on a server running centOS 5.2 64bit linux. Since we're using the stable release package (version 0.7.3.1928), the necessary files for retrieving email were not included. Thus, I went to http://www.redmine.org/repositories, downloaded imap.rb (rev 1572) and email.rake (rev 1764), and placed them into their appropriate locations: /var/www/html/redmine/redmine-0.7/lib/redmine/ and /var/www/html/redmine/redmine-0.7/lib/tasks/, respectively. We're running the development rails environment

However, when I try to run the retreive_imap task, I get the following error message:

[root@mobjustice redmine-0.7]# rake redmine:email:receive_imap RAILS_ENV="development" host=imap.gmail.com port=993 ssl=1 username= password=1234 --trace
(in /var/www/html/redmine/redmine-0.7)

  • Invoke redmine:email:receive_imap (first_time)
  • Invoke environment (first_time)
  • Execute environment
    GLoc v1.1 running in development mode. Strings can be modified at runtime.
  • Execute redmine:email:receive_imap
    rake aborted!
    wrong number of arguments (2 for 1)
    /var/www/html/redmine/redmine-0.7/lib/redmine/imap.rb:35:in `receive'
    /var/www/html/redmine/redmine-0.7/lib/redmine/imap.rb:35:in `check'
    /var/www/html/redmine/redmine-0.7/lib/redmine/imap.rb:32:in `each'
    /var/www/html/redmine/redmine-0.7/lib/redmine/imap.rb:32:in `check'
    /var/www/html/redmine/redmine-0.7/lib/tasks/email.rake:102
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:391:in `call'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:391:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:391:in `each'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:391:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:361:in `invoke'
    /usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:354:in `invoke'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1738:in `top_level'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1738:in `each'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1738:in `top_level'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1760:in `standard_exception_handling'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1732:in `top_level'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1710:in `run'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1760:in `standard_exception_handling'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1707:in `run'
    /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7
    /usr/bin/rake:16:in `load'
    /usr/bin/rake:16

I've tried countless variations in the syntax(including ssl=true, ssl=yes, RAILS_ENV=development, and even RAILS_ENV="production") to make sure that im not just typing the command wrong, but still no luck.

When I run script/about I get this output:

[root@mobjustice redmine-0.7]# RAILS_ENV=development script/about
GLoc v1.1 running in development mode. Strings can be modified at runtime.
About your application's environment
Ruby version 1.8.5 (x86_64-linux)
RubyGems version 0.9.4
Rails version 2.0.2
Active Record version 2.0.2
Action Pack version 2.0.2
Active Resource version 2.0.2
Action Mailer version 2.0.2
Active Support version 2.0.2
Application root /var/www/html/redmine/redmine-0.7
Environment development
Database adapter mysql

Does anyone have any advice about this problem? I'd greatly appreciate anything you can tell me. Thanks.

-David


Replies (1)

RE: retreive_imap task not working --wrong number of arguments (2 for 1) error - Added by Jean-Philippe Lang over 15 years ago

Thus, I went to http://www.redmine.org/repositories, downloaded imap.rb (rev 1572) and email.rake (rev 1764), and placed them into their appropriate locations

It's not enough to make it work. imap.rb is not compatible with the old MailHandler.
Try to replace app/models/mail_handler.rb with the new one from trunk. I can't guarantee that it works.
The solution would be to upgrade your install to current trunk.

    (1-1/1)