Cron task for handling email in redmine

Go to the redmine folder and copy the use_redmine file:

cp use_redmine proceed_mail

Open the new file:

nano ./proceed_mail

Replace its contents with this, using your own values:

#!/bin/bash

. /opt/redmine-3.3.2-2/scripts/setenv.sh

rake -f /opt/redmine-3.3.2-2/apps/redmine/htdocs/Rakefile redmine:email:receive_imap \
  RAILS_ENV="production" host=mail_server username=redmine@example.com password=your_password \
  move_on_success=read move_on_failure=failed

Open the Cron config:

crontab -e

Add this line to the end of the file, with your own values:

*/5 * * * * /opt/redmine-3.3.2-2/proceed_mail
I do product consulting, build MVPs and teach people to build products themselves. Work with me →