<?xml version="1.0" encoding="UTF-8"?>
<issue>
  <id>1616</id>
  <project name="Redmine" id="1"/>
  <tracker name="Patch" id="3"/>
  <status name="New" id="1"/>
  <priority name="Normal" id="4"/>
  <author name="Joshua Hoover" id="1516"/>
  <category name="Forums" id="5"/>
  <subject>Allow email to create and reply to forum messages</subject>
  <description>h2. Summary

This is a patch for #277 that provides the ability to send messages to forums via email.  This gives Redmine a mailing list like capability by utilizing the work done in #1110 (Allow email to create issue or add comment), which has been available since r1572.  By enabling this functionality users can create new and reply to existing forum messages that will be sent out via email to all those who are _watching_ that forum.  

h2. Configuration

There are two areas of configuration for this feature.  One is how you get emails into Redmine and the other is an optional configuration to set a different _emission email address_ specifically for forum emails.  

h3. Receiving Forum Message Emails for Redmine Processing

In order to receive emails into Redmine the documentation found [[RedmineReceivingEmails|here]] should be used.  This documentation covers specific settings for creating issues within Redmine.  The only issue attribute that applies to this patch is the project attribute.  If you set the project attribute.  I have done my functional testing using the IMAP setup.  The rake command looks something like this:

&lt;pre&gt;
rake redmine:email:receive_imap host=imap.domain.com port=XXX ssl=true username=username@domain.com password=password_here RAILS_ENV=_production_
&lt;/pre&gt;

Using the IMAP setup, you must schedule the rake command to run on a regular basis using cron or another job scheduling mechanism.

h3. Forum Emission Email Address

If you want to use a different _reply-to_ email address for forum messages than you use for other emails sent from Redmine, then you'll need to do the following:

# Login to your Redmine instance as an Administrator
# Click the _Administration_ link at the top of the page
# Click on the _Settings_ link
# Click on the _Email Notifications_ tab
# Enter the email address for forum emails in the _Forum emission email address_ field
#* This email address should go to the email account receiving forum emails (configured above in the _Receiving Forum Message Emails for Redmine Processing_ section)
# Click the _Save_ button

h2. User Documentation

The following describes how to make use of the email to forum functionality.

h3. How to Create a New Forum Message via Email

In order to create a new forum message, you simply address an email to the email address specified in either the Adminitration-&gt;Settings-&gt;Email Notifications _Forum emission email address_ field (if populated) or the _Emission email address_ (if the the _Forum emission email address_ field is not populated).  The subject of the email should be in the format of: 

[Project Name - Forum Name] Forum message subject goes here

The format of the email body is not important.  The script that processes the forum emails is setup to determine the project and forum names based on the email subject.

h3. How to Reply to a Forum Message via Email

This is pretty simple. When you receive an email of a forum message you simply reply to the message and write your reply in the body of the email.  One important thing to note is that you *SHOULD NOT* change the subject line if you want the email to be recognized as a reply to an existing forum message.  The script that processes the forum emails is setup to determine the original forum message being replied to by the portion of the subject that follows the square brackets.

h3. Receive Forum Message Emails in Your Email Inbox

In case it's not clear how you receive forum messages, I'm adding that info here.  The best way to subscribe to receive emails for a particular forum is to:

# Click on the _Forums_ tab in Redmine
# Click on the name of the forum you want to subscribe to
# Click on the _Watch_ link so that the star icon turns yellow

You can also subscribe to all forums (and all other Redmine email notifications) by clicking on the _My account_ link in the upper right hand of the page and then select _For any event on all my projects_ from the drop down menu under the _Email notifications_ section.</description>
  <start_date>2008-07-10</start_date>
  <due_date></due_date>
  <done_ratio>0</done_ratio>
  <estimated_hours></estimated_hours>
  <created_on>Thu Jul 10 02:37:03 +0200 2008</created_on>
  <updated_on>Sat Nov 28 16:31:31 +0100 2009</updated_on>
  <changesets>
    <changeset revision="2289">
      <user name="Jean-Philippe Lang" id="1"/>
      <comments>Allow email to reply to a forum message (#1616).</comments>
      <committed_on>Mon Jan 19 20:03:53 +0100 2009</committed_on>
    </changeset>
    <changeset revision="2294">
      <user name="Jean-Philippe Lang" id="1"/>
      <comments>Accept replies to forum messages by subject recognition (#1616).</comments>
      <committed_on>Wed Jan 21 19:22:30 +0100 2009</committed_on>
    </changeset>
  </changesets>
  <journals>
    <journal id="3826">
      <user name="Joshua Hoover" id="1516"/>
      <notes>My initial diff didn't have the test fixtures needed to run the unit tests.</notes>
      <details>
        <detail old="" name="753" property="attachment" new="feature_277_mailing_list_forum_integration_with_test_fixtures.diff"/>
      </details>
    </journal>
    <journal id="5517">
      <user name="Jean-Philippe Lang" id="1"/>
      <notes></notes>
      <details>
        <detail old="2" name="fixed_version_id" property="attr" new=""/>
      </details>
    </journal>
    <journal id="5604">
      <user name="Joshua Hoover" id="1516"/>
      <notes>I've had this patch running using IMAP for about a 35 user instance of Redmine without problems.  Any chance this gets into Redmine in the future? :)</notes>
      <details>
      </details>
    </journal>
    <journal id="6475">
      <user name="Brad Schick" id="2717"/>
      <notes>Would be nice to have this. Seems rather surprising that Redmine supports email integration for issues, but not for forums since forums integration would appear simpler.</notes>
      <details>
      </details>
    </journal>
    <journal id="6495">
      <user name="Andreas Huggel" id="3202"/>
      <notes>+1 for this, I think this is needed to complete #1110: Currently, with email for issues enabled, if a user replies to a forum post, the email ends up creating a new issue. I'll wait for this feature before turning on any email support.

Besides, at least in my project, there is more traffic in the forum than the issue tracker and of the 270 users some prefer a forum and others, especially people who are involved in several projects, prefer a mailing-list interface. I'd like to make it as easy as possible for both camps to contribute.
</notes>
      <details>
      </details>
    </journal>
    <journal id="6613">
      <user name="Andreas Huggel" id="3202"/>
      <notes>Just to stress again that this is a real requirement, please see: http://uk.groups.yahoo.com/group/exiv2/message/1501

After announcing the intention to change, I am now finding myself justifying the switch from a Yahoo group to a forum. Those who are challenging the decision are an important user and a key contributor.

There has been no feedback from the project team here since Jean-Philippe removed this issue from the 0.8 roadmap. It would be good to know what the plan is for this issue. Is there any non-obvious constraint that's holding this back?</notes>
      <details>
      </details>
    </journal>
    <journal id="6614">
      <user name="Jerome Vanthournout" id="3005"/>
      <notes>+1</notes>
      <details>
      </details>
    </journal>
    <journal id="6620">
      <user name="Eric Davis" id="5"/>
      <notes>Andreas Huggel wrote:
&gt; There has been no feedback from the project team here since Jean-Philippe removed this issue from the 0.8 roadmap. It would be good to know what the plan is for this issue. Is there any non-obvious constraint that's holding this back?

I"m sorry if there wasn't a reason let when it was removed from 0.8.  We dropped a bunch of features because we wanted to get 0.8 out in 2008 and it was accumulating too many features and the release date kept slipping.  I haven't checked the patch but I think this feature could be added to 0.9.  My personal goals with 0.9 is adding in better automation and integration with external tools and this is right in line with that goal.</notes>
      <details>
        <detail old="100" name="done_ratio" property="attr" new="0"/>
      </details>
    </journal>
    <journal id="6773">
      <user name="Jean-Philippe Lang" id="1"/>
      <notes>r2289 adds ability to reply to forum messages. The subject of the reply can be changed since the application will use the In-Reply-To and References headers to determine the message that the email replies to.

Concerning message creation via email, I think that having to use the syntax [Project Name - Forum Name] in the email subject can be cumbersome. What about assigning an (optional) email address to each forum? This way, users would just have to email to this address to post a message.</notes>
      <details>
      </details>
    </journal>
    <journal id="6776">
      <user name="Joshua Hoover" id="1516"/>
      <notes>Jean-Philippe,

I agree that forcing the syntax of [Project Name - Forum Name] in the email subject is cumbersome. The issue I ran into with using "References" headers was that I couldn't seem to reliably get them to stay intact when replying via clients like MS Outlook. If this technique works then that's definitely the way to go.

Creating an email address for each forum is probably the safest and most user friendly way to handle things. However, if you setup a lot of forums across projects, there is the overhead of (manually and separately from setting up the forum in Redmine) setting up all those different email inboxes.

Great work on all of this!</notes>
      <details>
      </details>
    </journal>
    <journal id="6777">
      <user name="Arnaud Martel" id="443"/>
      <notes>Jean-Philippe Lang wrote:
&gt; Concerning message creation via email, I think that having to use the syntax [Project Name - Forum Name] in the email subject can be cumbersome. What about assigning an (optional) email address to each forum? This way, users would just have to email to this address to post a message.

First, many thanks for redmine. It's really a very nice application and I'm using it everyday. 
I'm working in a company where it's not very easy to create email addresses. Today, I have about 50 projects using Redmine and at least 2 forums per project. So, having an email address for each forum would be very very difficult for me... What I like in this patch (and I'm using it): I can let users manage their own projects, without having to create anything (except project itself and the associated repository). From my point of view, it's very flexible this way. Another good solution is to allow the 2 options (patch AND email address)... ;-)

Arnaud</notes>
      <details>
      </details>
    </journal>
    <journal id="6778">
      <user name="Andreas Huggel" id="3202"/>
      <notes>&gt; Concerning message creation via email, I think that having to use the syntax [Project Name - Forum Name] in the email subject can be cumbersome. What about assigning an (optional) email address to each forum? This way, users would just have to email to this address to post a message.

Thanks for looking into this. I support the idea of having an email address for each forum, that will make posting very straightforward.
</notes>
      <details>
      </details>
    </journal>
    <journal id="6779">
      <user name="Andreas Huggel" id="3202"/>
      <notes>Will an anonymous user be able to post to the forums using these email addresses? If that should be possible at all, maybe an additional permission to enable anonymous posting by email is required (disabled by default).
</notes>
      <details>
      </details>
    </journal>
    <journal id="6805">
      <user name="Jean-Philippe Lang" id="1"/>
      <notes>&gt; The issue I ran into with using "References" headers was that I couldn't seem to reliably get them to stay intact when replying via clients like MS Outlook.

Indeed. I've added subject parsing too in r2294 (topic id was added to the notification subject to identify the topic without ambiguity).</notes>
      <details>
      </details>
    </journal>
    <journal id="12013">
      <user name="Hiro SHINOHARA" id="9521"/>
      <notes>Is this work with a recent version? It wasn't on my Redmine 0.8.5.

I fixed some part of code to use this cool patch.

* &lt;a href="http://www.messaliberty.com/2009/11/how-to-use-email-to-create-and-reply-to-forums-on-redmine/"&gt;How To Use Email To Create And Reply To Forums on Redmine &#171; messaliberty&lt;/a&gt;</notes>
      <details>
      </details>
    </journal>
    <journal id="12560">
      <user name="Andreas Huggel" id="3202"/>
      <notes>Any chance this can make it into 0.9?
Thanks</notes>
      <details>
      </details>
    </journal>
  </journals>
</issue>
