How To Setup Redmine to Receive Email on Dreamhost Using Postfix
If you are like me you've found there is a dearth of clear instructions how to do this. I did it. Works Great!
Here are my step by step instructions:
NOTE: I'm assuming you have a Dreamhost account, are familiar with their control panel, and are just a little command line savvy...
1. Set up a Dreamhost user with ssh access
You'll get an email from Dreamhost telling you how to access this new shell account. You'll need to note the server - xxx.dreamhost.com to access the email account associated with it. Log in to your account via ssh. In terminal type:
ssh username
xxx [dot] dreamhost [dot] com
Enter your password and you should be logged in.
2. Dreamhost ssh users can get email, but there is no way to check their email so you'll need to use an alias email address and forward incoming emails to them. Note, you can use filters to forward to the ssh user and there are a number of tutorials around the web on how to do this. However, for my purposes, I wanted to have the flexibility of an alias doing the forwarding.
Set up the alias to forward emails to the ssh account NOT by using your own domain names. You'll forward instead to sshusername
dreamhostservername [dot] dreamhost [dot] com (you'll get the server name in the welcome email).
3. Create the .forward.postfix file in your root directory - this enables mail manipulation via procmail (the MTA) incoming email to the redmine script. Type the following at the command prompt and insert the text shown:
cd ~ vim .forward.postfix
Type i (puts the vim word processor into insert mode).
Copy the text block below and paste it into the terminal.
#========================================== #.forward.postfix should be located in ~ "| /usr/bin/procmail -t" #==========================================
Type ESC (take vim out of insert mode)
Type :wq and hit the enter key (the : tells the word processor you are giving a command and the w stands for write and the q for quit).
4. Create the directory to hold the redmine email script
mkdir procmail
5. Copy your rdm-mailhandler.rb into the new procmail directory (you can use ftp or whatever file protocol you like).
6. Enter into your Redmine setup and use Administration/Settings/Incoming emails to set up your key.
7. Create the .procmailrb file in your root directory. This step edits the file that specifies which rules are applied to your e-mail. You will reference the rdm-mailhandler.rb file you already created. Type the following at the command prompt and modify the file as shown.
cd ~ vim .procmailrc
Type i (puts the word processor into insert mode).
Copy the text block below and paste it into the termina (NOTE replace the url and key with your own versionl:
#======================================= 1. .procmailrc should be located in ~ 2. Uncomment the following three lines to debug LOGFILE=$HOME/procmail.log VERBOSE=yes LOGABSTRACT=all 3. Directory for procmail-related files PMDIR=$HOME/procmail 4. How shell scripts should be run SHELL=/bin/sh 5. This is the message directory MAILDIR=$HOME/Maildir 6. procmail will forward all mail to rdm-mailhandler.rb :0 |$PMDIR/rdm-mailhandler.rb --url <a href="http://yoururl.com" title="http://yoururl.com">http://yoururl.com</a> --key yourkey --verbose #=======================================
Type ESC
Type :wq and hit the enter key.
Use the logs - procmail.log and the redmine log to troubleshoot. However I found this worked fine.
Goooood LUCK.

Comments
#1 Code blocks jacked
#2 Thanks. Working on a fix.
Post new comment