Redmine 3.3.3 IMAP Cron Job Failing
Added by Ray Burgoyne over 7 years ago
Hello,
We are upgrading to a new Redmine server from 2.5.x. to 3.3.3 and I am having difficulty getting a Redmine crontab job to pull email using IMAP.
Here is my crontab entry:
* * * * * root /usr/local/bin/rake -f redmine:email:receive_imap RAILS_ENV="production" host=smtp.mymailserver.com username=redmine password=mypassword project=inbox tracker=Notification unknown_user=accept no_permission_check=1 &>> /var/www/redmine/log/redmine_imap.log
If I run the entry from the command line as root it executes fine. When crontab executes it I get the following error:
/usr/bin/env: ruby: No such file or directory
I know almost nothing about Ruby & Rails, and most Google results for the error talk about rewriting the Ruby code.
Our old server used: /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/rake , which doesn't exist on the new server.
I have tried replacing /usr/local/bin/rake with every 'rake' file on the server but get the same error.
Here is my path:
[root@redmine-new /]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
This is running on CentOS Linux release 7.3.1611 (Core)
Here are my Environment values
Environment:
Redmine version 3.3.3.stable
Ruby version 2.3.1-p112 (2016-04-26) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
SCM:
Subversion 1.7.14
Filesystem
Redmine plugins:
redmine_checklists 3.1.5
redmine_people 1.3.0
Any help is greatly appreciated. This is the last piece to get working before migrating to the new server.
Replies (4)
RE: Redmine 3.3.3 IMAP Cron Job Failing - Added by Ray Burgoyne over 7 years ago
Figured it out... I added the Ruby path to the cron task
- * * * * root PATH=$PATH:/usr/local/bin rake -f redmine:email:receive_imap RAILS_ENV="production" host=smtp.mymailserver.com username=redmine password=mypassword project=inbox tracker=Notification unknown_user=accept no_permission_check=1 &>> /var/www/redmine/log/redmine_imap.log
RE: Redmine 3.3.3 IMAP Cron Job Failing - Added by stavros chalaris about 7 years ago
I have exactly the same issue and I am looking to set cron job.
I want to ask you about the user name and password from which? from host smtp?
You type project=inbox what does it mean? I want from the whole projects and from the whole users to send mail alerts.
RE: Redmine 3.3.3 IMAP Cron Job Failing - Added by stavros chalaris about 7 years ago
I have set the following line in cron job but no mail alert is coming. Either any message to error.log
Do you know the reason?
/home/domain/public_html/local/bin/rake/error.log -f redmine:email:receive_imap RAILS_ENV="production" host=smtp.domain.com username=username@domain.com password=xxx project=inbox tracker=Notification unknown_user=accept no_permission_check=1 &>> /home/domain/public_html/rails_apps/redmine/log/redmine_imap.log
RE: Redmine 3.3.3 IMAP Cron Job Failing - Added by Ray Burgoyne about 7 years ago
The cron task is used to pull emails from an email account into a Redmine project.
The username/password is to the email account, and I am only using the username 'redmine', no FQDN.
"Inbox" is a project setup in our Redmine server. It is used strictly to for pulling emails for redmine@yourdomain.com. You will need to either create a project named "Inbox" or change the cron task to match an existing project.
To test you will need to send am email to redmine@yourdomain.com. Try running the cron task manually and see if the email is imported.