From 5a337e2a85991e08250a0d5101f181ad96b20c42 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Mon, 26 Mar 2018 12:05:43 -0400 Subject: [PATCH] Add a README --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..58eb1bc --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# README + +## Installation + +* `git clone` this repository on to a server with incoming SMTP enabled. I recommend running both a live and test copy. For instance, store in both `/usr/local/bin/redirect` and `/usr/local/bin/redirect_test`. +* In `/etc/aliases`, set up aliases. E.g.: + +``` +support: "| /usr/local/bin/redirect/redirect.php" +support-test: "| /usr/local/bin/redirect_test/redirect.php" +``` + +* Run `newaliases` as root for the aliases to take effect. +* Run `composer install` in the directory to install dependencies. +* Copy `.env.example` to `.env`. +* Open `.env` and fill in the appropriate environment values. Note that for the boolean values (e.g. `DEBUG_MODE`), you should leave the values blank for false. +* (Optional) Add a custom field in Redmine called "Email Domain" to the Projects entity of type "Text". Populate this with the domain name that emails come from. This catches users from the organization who don't otherwise haev an account. +* Run `php getmappings.php` to test your settings. If you've set everything up correctly, it should populate two CSVs in the `data` folder: `domainmap.csv` and `usermap.csv`. +* If you have special emails that should be handled differently, you can create a `specialusers.csv` file in the `data` folder with the same format as records in `usermap.csv`. This file is concatenated on to the end of whatever users come from Redmine. +* Set up a cron job to generate the mappings. I run this once per hour: + +``` +45 3 * * * /usr/bin/php /usr/local/bin/redirect_test/getmappings.php +45 4 * * * /usr/bin/php /usr/local/bin/redirect/getmappings.php +```