0

我正在尝试使用此 rake 从 Gmail IMAP 服务器接收电子邮件并在 OpenProject 中创建任务。我已经设置了一个执行这个 rake 的 cron 作业:

rake redmine:email:receive_imap \
                        host="imap.gmail.com" \
                        username="username@gmail.com" \
                        password="pwd" \
                        ssl=true \
                        port=992 \
                        project="bugtest" \
                        tracker="bug" \
                        folder="INBOX"

执行后,我的收件箱文件夹中的电子邮件被标记为已读,但我在日志中收到此错误:

rake aborted!
Net::IMAP::NoResponseError:  No folder  (Failure)
/app/lib/redmine/imap.rb:96:in `message_error'
/app/lib/redmine/imap.rb:77:in `rescue in receive'
/app/lib/redmine/imap.rb:70:in `receive'
/app/lib/redmine/imap.rb:41:in `block in check'
/app/lib/redmine/imap.rb:40:in `each'
/app/lib/redmine/imap.rb:40:in `check'
/app/lib/tasks/email.rake:151:in `block (3 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
/usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'

Caused by:
Message was not successfully handled.
/app/lib/redmine/imap.rb:72:in `receive'
/app/lib/redmine/imap.rb:41:in `block in check'
/app/lib/redmine/imap.rb:40:in `each'
/app/lib/redmine/imap.rb:40:in `check'
/app/lib/tasks/email.rake:151:in `block (3 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
/usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
Tasks: TOP => redmine:email:receive_imap
(See full trace by running task with --trace)
E, [2021-04-29T13:58:01.220545 #33] ERROR -- : MailHandler: missing information from Boris Mamić: Unable to determine target project
I, [2021-04-29T13:58:01.220667 #33]  INFO -- : Received mail (3707.2ms)
E, [2021-04-29T13:58:01.220733 #33] ERROR -- : Message 9 resulted in error Message was not successfully handled. Message was not successfully handled.

有谁知道是什么原因?

谢谢!

4

0 回答 0