Record various problems and solutions encountered during Redmine mail synchronization Configuration
1. How to install Redmine
Http://www.redmine.org/projects/redmine/wiki/RedmineInstall
2. How to configure automatic email receiving and timed synchronization
Http://www.redmine.org/projects/redmine/wiki/How_to_install_Redmine_in_Linux_Windows_and_ OS _X_using_BitNami_Redmine_Stack in Windows
Http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails#Forwarding-emails-from-your-email-server in Unix-like environment
Because I mainly use the configuration in Mac, the following are the commands in Mac. It may be slightly different in other operating systems.
Because the email server is not self-built, you can only use the imap or pop3 synchronization method.
After testing, pop3 may have problems synchronizing QQ enterprise mailboxes, so imap is used.
3. Rake
Automatic email Receiving Method redmine: email: receive_imap requires rake to run
What is rake:
Rake Introduction
Http://hi.baidu.com/kenrome/item/0b178757da9c24948d12ed39
Official Rake documentation
Http://rake.rubyforge.org/
4. Conditions for running rake
To run rake, first find the folder where Rakefile is located.
For Redmine of BitNami, the installation directory is at:/Applications/redmine-2.3.0-0/apps/redmine/htdocs
When running rake, if the following error occurs:
Rake aborted!
No such file to load-Bundler/setup
The bundle is not installed.
In this case, you need to run the command to install bundle.
5. Install bundle
Run the following command in Terminal to install Bundle:
Gem install bundler
Bundle install
Bundle exec rake db: create
If you want to know what bundle is, you can view the link:
Http://guides.rubyonrails.org/getting_started.html#creating-a-new-rails-project
Http://stackoverflow.com/questions/7454361/rubygems-do-not-install-on-os-x-lion
Various Errors may occur when Bundle is installed.
I have met:
1. Json errors are solved by stackoverflow error messages.
2. rmagick Installation Error
Rmagick is the biggest headache because of an incompatible problem in rmagick 2.13.1. Although it was modified in version 2.13.2, bundle itself cannot select a version and can only be installed automatically 2.13.1
Correction Method:
Http://stackoverflow.com/questions/13942443/error-installing-rmagick-on-mountain-lion/13960185#13960185
The path in may need to be changed to/Users/<username>/. homebrew/Cellar/imagemagick/6.8.0-10/lib
Running bundle exec rake db: create may also encounter the following Error:
Image not found-/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Solution:
Http://stackoverflow.com/questions/8437455/rake-dbmigrate-mysql
A simple method is to run export DYLD_LIBRARY_PATH = "/usr/local/mysql/lib: $ DYLD_LIBRARY_PATH" before running all Terminal methods"
The permanent solution is to modify. bash_profile.
6. Run rake.
Redmine test account
Redmine.test@honestwalker.com
Password01!
If you want to run it directly in Terminal, run it first.
Cd/apps/redmine-2.3.0-0/apps/redmine/htdocs
Run again
Export DYLD_LIBRARY_PATH = "/usr/local/mysql/lib: $ DYLD_LIBRARY_PATH"
Last run
Bundle exec rake -- silent redmine: email: receive_imap unknown_user = accept no_permission_check = 1 RAILS_ENV = "production" host = export port = 993 username = redmine.test@honestwalker.com password = ***** ssl = 1 project = testproject1 tracker = Support
Some encoding problems may be reported, but you can ignore them.
(SSL may be required. It does not seem to be correctly charged if SSL is not used before)
7. Scheduled operation
In Unix-like systems, cron is used for scheduled operation.
For more information about cron, see:
Cron scheduled tasks (Unix-like systems)
Http://www.blogjava.net/chenlb/archive/2008/07/02/212123.html
Simply put:
Crontab-e is a task for modifying cron.
Crontab-l is used to view created cron tasks.
Crontab-r is used to delete all cron tasks.
If you want to use cron to execute a syntax example, see:
*/30 * cd/Applications/redmine-2.3.0-0/apps/redmine/htdocs
Because only one row can be executed for all tasks in cron, but three rows need to be executed, you need to use osascript (script in Mac)
8. osascript
The syntax of osascript is similar:
Osascript-e 'Tell application "terminal" '-e' do script "cd/"'-e' end tell'
A semicolon can be used to separate commands and execute multiple commands in the same Terminal window.
Therefore, the final osascript command is:
Osascript-e 'Tell application "terminal" '-e' do script "cd/Applications/redmine-2.3.0-0/apps/redmine/htdocs; export DYLD_LIBRARY_PATH = \ "/usr/local/mysql/lib: $ DYLD_LIBRARY_PATH \"; bundle exec rake -- silent redmine: email: receive_imap unknown_user = accept no_permission_check = 1 RAILS_ENV = \ "production \" host = export port = 993 username = redmine.test@honestwalker.com password = ***** ssl = 1 project = testproject1 tracker = Support "'-e' end tell'
9. Results
Run the following command:
*/30 * osascript-e 'Tell application "terminal" '-e' do script "cd/Applications/redmine-2.3.0-0/apps/redmine/htdocs; export DYLD_LIBRARY_PATH = \ "/usr/local/mysql/lib: $ DYLD_LIBRARY_PATH \"; bundle exec rake -- silent redmine: email: receive_imap unknown_user = accept no_permission_check = 1 RAILS_ENV = \ "production \" host = imap.exmail.qq.com port = 993 username = redmine.test@honestwalker.com password = *** ssl = 1 project = testproject1
Tracker = Support "'-e' end tell'
That's done.