Project

General

Profile

Creating ticket from email

Added by Santosh Bhabal almost 7 years ago

Hello Experts,

My Redmine version is 3.4.4.stable.17174

I followed below URL to configure my gmail a/c to fetch emails & create ticket.

http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails#Fetching-emails-from-an-IMAP-server

What I understood from above URL is that, I only need to set one cronjob to fetch the emails from my gmail a/c (correct me if I am wrong).

Cronjob is like:
*/30 * * * * rake -f /path/to/redmine/appdir/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com username= password=xxxx

So my question is:
What will be my '/path/to/redmine/appdir/Rakefile' ?
Is this the path of my document root where I have my redmine code placed?

Regards
sdbhabal.


Replies (9)

RE: Creating ticket from email - Added by Bernhard Rohloff almost 7 years ago

Hi, and welcome to the Redmine Community,

yes, you're right. "/path/to/redmine/appdir/" is your Redmine root directory. There you can also find the mentioned Rakefile. And yes. Setting up the cron job is the only think you have to do to receive emails.

Kind regards,

Bernhard

RE: Creating ticket from email - Added by Santosh Bhabal almost 7 years ago

Thanks Bernhard.

So I have scheduled below cron in my Redmine server root user.
*/30 * * * * rake -f /var/www/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com username= password=xxxx

And I have sent test email to my gmail account.
But unfortunately no ticket has been created into Redmine.
I don't know what is causing this issue, is there something I am missing.
Please help.

Regards
sdbhabal.

RE: Creating ticket from email - Added by Bernhard Rohloff almost 7 years ago

I would suggest you to test this with a separate shell script, first. It's way more comfortable to debug it this way. No waiting until next job, proper console outputs, etc...
If it's working that way, you have a proper configuration of the job. Afterwards you can implement it in your cron job.

Here is my script:

#!/bin/bash

PATH=$THE_USER_PATH

export RAILS_ENV=production

cd /path/to/redmine

bundle exec rake redmine:email:receive_imap \
host=redmine.yourdomain.de                  \
port=993                                    \
ssl=true                                    \
username=name@mailservice.de                \
password=v3ry53cr3t                         \
project=my_project                          \
project_from_subaddress=name@mailservice.de \
tracker=Uncategorized                       \
allow_override=project,tracker,priority

I invoke this script from my cron job, so I have to set the PATH variable correctly to have access to my ruby environment.

Kind regards,

Bernhard

RE: Creating ticket from email - Added by Santosh Bhabal almost 7 years ago

Bernhard,

I have changed below parameter in your script.

cd /path/to/redmine -> /var/www/redmine
host=redmine.yourdomain.de -> imap.gmail.com
username= -> my-gmail-user-id
password=v3ry53cr3t -> my-gmail-password
project=my_project -> Currently I dont have any project created in my Redmine, so what should I need to specify here.
project_from_subaddress= -> whats this?

RE: Creating ticket from email - Added by Bernhard Rohloff almost 7 years ago

With project you can specify the project the issue is create for. You can specify another project within your email or by projects_from_subaddress. With this parameter the project is chosen by an email tag.
This is all described in the link I've posted above.

Greetings,
Bernhard

RE: Creating ticket from email - Added by Santosh Bhabal almost 7 years ago

project & project_from_subaddress are mandatory or optional?

RE: Creating ticket from email - Added by Santosh Bhabal almost 7 years ago

Yes, It is working.
The only thing is that, I need to specify 'project: <projectname>' in the email body, then the ticket is getting created automatically.
Is there any way to specify assignee of the ticket? so that the ticket will get automatically assigned to desired person.

RE: Creating ticket from email - Added by Bernhard Rohloff almost 7 years ago

Quoting http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails#Issue-attributes :

Example keyword list:

Project
Tracker
Status
Category
Priority
Assigned to
Start date
Due date
Target version
Estimated hours
Done ratio
<Custom field name>

    (1-9/9)