Update README.md with tested instructions for installation
This commit is contained in:
31
README.md
31
README.md
@@ -114,3 +114,34 @@ Processed XML files ready for final consumption live in the ```xml``` directory
|
||||
along with the DTD. This directory is also unimportant for backup purposes
|
||||
depending on your requirements for xml files post-consumption. That said, The
|
||||
DTD file __MUST__ exist there.
|
||||
|
||||
## Installation
|
||||
|
||||
Because this script uses a python virtual environment, and is designed to run
|
||||
from ```cron``` it should be installed like so (it is assumed there is a
|
||||
working python3 and pip3 on the system).
|
||||
|
||||
* Perform the following steps in your home directory (or some other location
|
||||
where you have filesystem permissions):
|
||||
```
|
||||
git clone https://git.hamiltron.net/greig/email_to_xml.git
|
||||
cd email_to_xml
|
||||
pip3 install virtualenv
|
||||
virtualenv email_to_xml
|
||||
mkdir xml
|
||||
touch .env
|
||||
```
|
||||
|
||||
* Copy your verified DTD file into the xml directory.
|
||||
* Edit .env and configure the correct values for your setup.
|
||||
* Create your self-signed certificate and key as follows:
|
||||
```openssl req -x509 -newkey rsa:4096 -keyout one.key -out one.crt -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname"```
|
||||
|
||||
If you wish to run the script interactively from the commandline, you will
|
||||
first need to activate the virtual environment:
|
||||
```. ./email_to_xml/bin/activate```
|
||||
You may now run ```./getmail.py``` - you can see the result of the run in
|
||||
```./getmail.log```.
|
||||
|
||||
Here is an example crontab line to run the script every 5 minutes:
|
||||
```*/5 * * * * cd ~/email_to_xml && ./email_to_xml/bin/python3 ~/email_to_xml/getmail.py```
|
||||
|
||||
Reference in New Issue
Block a user