*/5 * * * * /usr/bin/php /home/incoming/mail2deck/index.php >/dev/null 2>&1
+### Docker installation
+Clone and edit the config.example.php you find in this repository and move it as config.php
+```
+git clone https://github.com/newroco/mail2deck.git mail2deck
+cd mail2deck
+cp config.example.php config.php
+nano config.php
+```
+
+Build your image locally
+```
+docker build -t mail2deck:latest .
+```
+
+Run the docker image mapping the config.json as volume
+```
+docker run -d --name mail2deck mail2deck:latest
+```
+
+Edit your crontab
+```
+crontab -e
+```
+
+And add this line
+```
+*/5 * * * * /usr/bin/docker start mail2deck
+```
+
## Finish
Now __mail2deck__ will add new cards every five minutes if new emails are received.
diff --git a/composer.lock b/composer.lock
index c693662..6840597 100644
--- a/composer.lock
+++ b/composer.lock
@@ -104,5 +104,5 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
- "plugin-api-version": "2.1.0"
+ "plugin-api-version": "2.3.0"
}
diff --git a/config.example.php b/config.example.php
index 52c6365..c5e37ed 100644
--- a/config.example.php
+++ b/config.example.php
@@ -5,6 +5,7 @@ define("NC_PASSWORD", "****");
define("MAIL_SERVER", "localhost"); // server.domain
define("MAIL_SERVER_FLAGS", "/novalidate-cert"); // flags needed to connect to server. Refer to https://www.php.net/manual/en/function.imap-open.php for a list of valid flags.
define("MAIL_SERVER_PORT", "143");
+define("MAIL_SERVER_SMTPPORT", "587"); // port for outgoing smtp server. Actually only used to configure Docker image outgoing SMTP Server
define("MAIL_USER", "incoming");
define("MAIL_PASSWORD", "****");
define("DECODE_SPECIAL_CHARACTERS", true); //requires mbstring, if false special characters (like öäüß) won't be displayed correctly
diff --git a/docker-utils/configure_smtp.sh b/docker-utils/configure_smtp.sh
new file mode 100755
index 0000000..90016db
--- /dev/null
+++ b/docker-utils/configure_smtp.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+CONFIG_FILE_PATH="config.php"
+
+cat > /etc/ssmtp/ssmtp.conf <Check out this link to see your newly created card.
'; +$headers = array( + 'From' => 'no-reply@example.com', + 'MIME-Version' => '1.0', + 'Content-Type' => 'text/html' +); + +mail($to, $subject, $message, $headers); diff --git a/index.php b/index.php index 1d8fba6..a1d42ac 100644 --- a/index.php +++ b/index.php @@ -98,13 +98,13 @@ if ($emails) $newcard = new DeckClass(); $response = $newcard->addCard($data, $mailSender, $board); - $mailSender->userId .= "@{$overview->reply_to[0]->host}"; + $mailSender->origin .= "{$overview->reply_to[0]->mailbox}@{$overview->reply_to[0]->host}"; if(MAIL_NOTIFICATION) { if($response) { - $inbox->reply($mailSender->userId, $response); + $inbox->reply($mailSender->origin, $response); } else { - $inbox->reply($mailSender->userId); + $inbox->reply($mailSender->origin); } } if(!$response) {