Project

General

Profile

Problem creating issues from emails with attachment

Added by Matt Hamilton almost 14 years ago

Hi, I'm have trouble getting redmine to create issues from emails with attachment.

Redmine is retrieving and adding issues correctly except when when the email has an attachment. If the email has an attachment it adds the issue but does not delete the email. If the attachment is a .pdf the attachment is not added to the bug if the attachment is a jpg it is added to the bug. You can see the 3 IMAP log extracts below the 3rd is the one with the attachment and the server is not issued with the Deleted flag and not expunged. The attachment is smaller than the max attachment size.

I'm guessing an error is happening some where or perhaps its meant to be this way. I'm new to ruby so I'm not sure where to start looking to figure this out I would be grateful for any suggestions.

What's running
- Redmine 0.9.4.devel.3739
- Ruby 1.8.7 [x86_64-linux]
- Rails version (rails --version): Rails 2.3.5
- Operating system: Debian 5.0.3
- MySQL 14.12 Distrib 5.0.51a
- Apache/2.2.9 + Passenger 2.2.11

I have a cron job setup to retrieve with the following command

*/5 * * * * redmine rake -f /var/www/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=mail.mydomain.com username= password=mypassword project=myproject tracker=bug allow_override=tracker,project

The IMAP log from the SMTP server

FIND AN ISSUE NO ATTACHMENT

05:30:32 [xxx.xxx.xxx.xxx][14658007] logged in
05:30:33 [xxx.xxx.xxx.xxx][14658007] command: RUBY0002 SELECT INBOX
05:30:33 [xxx.xxx.xxx.xxx][14658007] command: RUBY0003 SEARCH NOT SEEN
05:30:33 [xxx.xxx.xxx.xxx][14658007] command: RUBY0004 FETCH 1 RFC822
05:30:34 [xxx.xxx.xxx.xxx][14658007] command: RUBY0005 STORE 1 +FLAGS (\Seen \Deleted)
05:30:34 [xxx.xxx.xxx.xxx][14658007] command: RUBY0006 EXPUNGE
05:30:34 [xxx.xxx.xxx.xxx][14658007] disconnected at 27/05/2010 5:30:34 a.m.

FIND NO ISSUES

05:45:32 [xxx.xxx.xxx.xxx][15509203] connected at 27/05/2010 5:45:32 a.m.
05:45:32 [xxx.xxx.xxx.xxx][15509203] command: RUBY0001 LOGIN XXXX
05:45:32 [xxx.xxx.xxx.xxx][15509203] logged in
05:45:32 [xxx.xxx.xxx.xxx][15509203] command: RUBY0002 SELECT INBOX
05:45:33 [xxx.xxx.xxx.xxx][15509203] command: RUBY0003 SEARCH NOT SEEN
05:45:33 [xxx.xxx.xxx.xxx][15509203] disconnected at 27/05/2010 5:45:33 a.m.

FIND AN ISSUE WITH ATTACHMENT

05:50:32 [xxx.xxx.xxx.xxx][2118071] connected at 27/05/2010 5:50:32 a.m.
05:50:32 [xxx.xxx.xxx.xxx][2118071] command: RUBY0001 LOGIN XXXX
05:50:32 [xxx.xxx.xxx.xxx][2118071] logged in
05:50:33 [xxx.xxx.xxx.xxx][2118071] command: RUBY0002 SELECT INBOX
05:50:33 [xxx.xxx.xxx.xxx][2118071] command: RUBY0003 SEARCH NOT SEEN
05:50:33 [xxx.xxx.xxx.xxx][2118071] command: RUBY0004 FETCH 1 RFC822
05:50:33 [xxx.xxx.xxx.xxx][2118071] disconnected at 27/05/2010 5:50:33 a.m.

Thanks


Replies (2)

RE: Problem creating issues from emails with attachment - Added by Matt Hamilton almost 14 years ago

running with --trace shows this error

(in /var/www/redmine)
  • Invoke redmine:email:receive_imap (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute redmine:email:receive_imap
    rake aborted!
    undefined method `[]' for nil:NilClass
    /usr/lib/ruby/1.8/net/imap.rb:1160:in `search_internal'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /usr/lib/ruby/1.8/net/imap.rb:1154:in `search_internal'
    /usr/lib/ruby/1.8/net/imap.rb:679:in `search'
    /var/www/redmine/lib/redmine/imap.rb:32:in `check'
    /var/www/redmine/lib/tasks/email.rake:133
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
    /usr/bin/rake:19:in `load'
    /usr/bin/rake:19

RE: Problem creating issues from emails with attachment - Added by Matt Hamilton almost 14 years ago

I haven't found a fix for the imap problem but but using the pop3 method works correctly

*/5 * * * * redmine rake -f /var/www/redmine/Rakefile redmine:email:receive_pop3 RAILS_ENV="production" host=mail.mydomain.com username= password=mypassword project=myproject tracker=bug allow_override=tracker,project

    (1-2/2)