Provides an "email in" solution for the Nextcloud Deck app
 
 
 
Go to file
Ben P 52d3ceb66e Allow flags for connecting to IMAP server to be specified in config.php and update README to show how to use a non-self-hosted IMAP server. 2021-12-30 17:29:25 -07:00
attachments some changes. 2019-12-13 20:22:40 +02:00
lib delete print_r. 2019-12-16 20:00:43 +02:00
README.md Allow flags for connecting to IMAP server to be specified in config.php and update README to show how to use a non-self-hosted IMAP server. 2021-12-30 17:29:25 -07:00
config.php Allow flags for connecting to IMAP server to be specified in config.php and update README to show how to use a non-self-hosted IMAP server. 2021-12-30 17:29:25 -07:00
index.php Allow flags for connecting to IMAP server to be specified in config.php and update README to show how to use a non-self-hosted IMAP server. 2021-12-30 17:29:25 -07:00

README.md

mail2deck

Provides an "email in" solution for the Nextcloud Deck app

A. For users

Retains the following:

  1. Email subject is the card title, and email body is the card description!
  2. You can add even attachments to the email and they will be transposed as attachments of the card.
  3. mail2deck doesn't add stacks (for now), so you must to have at least one stack on the board you want to add the cards.

To have the feature as your email to be transformed in a Deck card you have to follow some easy steps.

1) Deck Bot needs to be assigned as a user of the board that you want to add the cards.

The card will be assigned to the Deck Bot. In case you aren't the board owner or you haven't rights to add users to the board, we consider that mail2deck for that board is disabled.

2) Send the email.

You have two posibilities to choose the board that you want to add the card:

1) Set the board in the email subject

We interprate that is mail subject: mail subject b-'personalBoard'
You can use single or double quotes, and the word from inside the quotes has to be exactly the board name. For the stack you can use: mail subject b-'personalBoard' s-'important stuff' or not, because the default stack is the left one.

2) Set the board in the email address

For that, we have to introduce you the structure of the email address.
The email address is composed like: incoming+boardname@server.domain, and string between the plus (+) and the at (@) needs to be exactly the board name that you want to add the card.

B. For NextCloud admins to setup

Requirements

This app requires php-curl, php-imap and some sort of imap server (e.g. Postfix with Courier).

NC new user

Create a new user from User Management on your NC server, which will have to function as a bot. We chose to call him deckbot, but you can call it however you want.
Note: that you have to assign deckbot on each board you want to add new cards from email.

Configure Email

Option 1 - Set up Postfix for incoming email

You can setup Posfix mail server folowing the instructions on Posfix setup, and after that add "+" delimiter (which separe the user from the board in the email address) using the command:

sudo postconf -e "recipient_delimiter = +"

Option 2 - Use an existing email server.

This could be any hosted email service. The only requirement is that you can connect to it via the IMAP protocol. Please note this option may not be as flexible as a selfhosted server. For example your email service may not support the "+"delimeter for directing messages to a specific board

Download and install

If using a self-hosted Postfix server, clone this repository into incoming user. If not you may need to create a new user on your system and adjust the commands in future steps to match that username.

cd /home/incoming/
git clone https://github.com/putt1ck/mail2deck.git mail2deck

Edit the config file as you need:

sudo nano /home/incoming/mail2deck/config.php

Add a cronjob which will run mail2deck.

sudo crontab -u incoming -e

Add the following line in the opened file: */5 * * * * /usr/bin/php /home/incoming/mail2deck/index.php >/dev/null 2>&1

Finish

Now mail2deck will add new cards every five minutes if new emails are received.