Patch #1110
closedAllow email to create issue or add comment
100%
Description
Summary¶
This is a patch for #1083 that implements an email conduit for accepting issue creation or comments via email. It's implemented as a standalone script which can be placed in your sendmail aliases configuration to receive email messages from an alias.
Configuration¶
The user is responsible for the email alias configuration. There is some flexibility in configuration. The script gathers the following parameters in order to create a new bug:
- issue
- project
- subject
- description
- status
- tracker
- priority
- category
- author
These parameter can either come from the command line parameters given to the bugmail.rb script, or from the contents of the email message. If the parameter is specified in the email, it takes the form 'Param: value of param' where the parameter name is capitalized, and the value is whatever is left on the line. The exception is 'Description:' which takes whatever text is left to the end of the email. MIME attachments are not supported (yet... any takers?)
There is an option in the script to allow override of command line parameters by email information. This provides some measure of control over the bug creation process. For example:
Use special tracker for bugmail¶
If you want to use a special tracker, configure the tracker in your redmine project. Add the '--tracker TrackerName' parameter to the script in your /etc/aliases file, and don't use '--allow-overrides' This will force the tracker parameter to whatever you specify, regardless of the contents of the email.
Specifying project parameter¶
There are three options for specifying the project. One is to use the '--use-email-header' option, which grabs the project identifier from the 'To:' field of the email by decoding the address projectident@hostname.com.
Another option is to use the '--project projectid' option and don't use '--allow-overrides'.
A third option might be to use one alias, (e.g. redmine@hostname.com) and require the 'Project:' tag to be present in the email.
Specifying the author¶
There are two ways of specifying the author. Either via the 'Author:' tag in the email body, or by matching the 'From:' field in the email headers with the email address of a particular user (if --use-email-header option is active).
Adding Comments¶
In order to add comments, the only real information required is the 'Issue:' id and the 'Description:' text, which will be used as the comment. Again, MIME attachments are not supported (yet...)
Script Usage¶
Usage: [--help] [--debug] [--allow-override] [--use-email-header] [--file <filename> ] [--<param> <value> ...] --help show this help --debug show extra debug information --allow-override allow message contents to override cmd line args --use-email-header search in email header for user, subject and project --file get input from a file instead of STDIN --<param> set a parameter's value. Parameter is one of: issue, project, subject, desc, status, tracker, priority category, author
Example email¶
Received: by 10.114.159.7 with HTTP; Wed, 23 Apr 2008 19:40:37 -0700 (PDT) Message-ID: <5faca86f0804231940r7b170d3cp7b22cdb0b43586a7@mail.gmail.com> Date: Wed, 23 Apr 2008 22:40:37 -0400 From: "Carl Nygard" <cjnygard@gmail.com> To: "blech" <redmine@redmine.org> Subject: This is an issue created via email Category: Ticket Priority: Normal Tracker: Feature Description: This is a multiline description about the problem h2. with wiki *formatting*
Files
Related issues