User Tools

Site Tools


software:openproject:mail

This is an old revision of the document!


E-Mail Integration

OpenProject can check an e-mail account for specially formatted mail that will perform tasks within the system. This is described in https://docs.openproject.org/installation-and-operations/configuration/incoming-emails/, though some of the stuff is not quite clear, so I'm adding notes here.

First, create an e-mail account someplace. I create two folders on the mail account, one named Processed and one named Failed.

Now OpenProject to check that account by running a cron job. It was easier for me to just create a bash script to do it since the command is fairly long. It also allows me to test the system easily.

openProject
#! /bin/bash
 
openproject run bundle exec rake --trace redmine:email:receive_imap \
   host='mail.example.org'\
   username='projects@example.org' \
   password='reallyG00D_Password?' \
   port=993 \
   ssl=true \
   allow_override=type,project \
   project=test_project \
   folder=INBOX \
   move_on_success=Processed \
   move_on_failure=Failed

What this code does is logs into mail.example.org with username projects@example.org and the password, and checks for e-mail. If no project is defined in the e-mail, it assigns the ticket to the project test_project.

If the e-mail is successfully parsed, the actions are taken and the e-mail is moved to the Processed folder on the mail server. If not, it is put in the Failed folder.

Run the script one time to verify you get no errors. If you don't, you can either put it someplace and set up the crontab, or (on Debian based systems), put it in /etc/cron.hourly. I only wanted it to run once an hour, so I did the latter.

software/openproject/mail.1594084364.txt.gz · Last modified: 2020/07/06 20:12 by rodolico