<commit_before># Hermes [![](https://travis-ci.org/Trancendances/hermes.svg?branch=master)](https://travis-ci.org/Trancendances/hermes)

Hermes is a bulk e-mail sender. It allows you to manage mailing lists and subscribers, and send them e-mails based on HTML template and
markdown content, in a self-hosted and respectful way. No more big superservice adding its own tracker to your emails.

:warning: **This project is still under heavy development and is not ready for production yet.**

## Dependencies

Hermes is a Node.js app, so you will need [Node.js](https://nodejs.org) at a [supported version](https://travis-ci.org/Trancendances/hermes), along NPM.

## Installing

To install Hermes, clone this repository and install the required NPM dependencies.
```
git clone https://github.com/Trancendances/hermes
cd hermes
npm install
```

## Starting

To start Hermes, run 
```
npm start
```
from the directory you installed it in. Hermes will run on port 1708 by default,
but you can override this value with the `PORT` environment variable.
```
PORT=8080 npm start
```

## Testing

To run Hermes's unit test, you first need to install it and its dependencies, then run 
```
npm test
```

## Contribute

If you like this project and want to help, there's many way to do it.

- Suggest new features in an [issue](https://github.com/Trancendances/hermes/issues)
- Report every bug or inconvenience you encountered during this software in the [issues](https://github.com/Trancendances/hermes/issues)
- Pick up an [issue](https://github.com/Trancendances/hermes/issues) and fix it by submitting a [pull request](https://github.com/Trancendances/hermes/pulls)
- Start implementing a new feature you'd like to use in the software*

\* Before you start implementing anything, please make sure to create an [issue](https://github.com/Trancendances/hermes/issues) about it if one hasn't been created yet.<commit_msg>Added configuration and database stuff<commit_after># Hermes [![](https://travis-ci.org/Trancendances/hermes.svg?branch=master)](https://travis-ci.org/Trancendances/hermes)

Hermes is a bulk e-mail sender. It allows you to manage mailing lists and subscribers, and send them e-mails based on HTML template and
markdown content, in a self-hosted and respectful way. No more big superservice adding its own tracker to your emails.

:warning: **This project is still under heavy development and is not ready for production yet.**

## Dependencies

Hermes is a Node.js app, so you will need [Node.js](https://nodejs.org) at a [supported version](https://travis-ci.org/Trancendances/hermes), along NPM.

## Installing

To install Hermes, clone this repository and install the required NPM dependencies.
```
git clone https://github.com/Trancendances/hermes
cd hermes
npm install
```

## Configuring

To configure Hermes with your own settings, you must put them in a JSON file at the root of this directory. This file includes three parts: One for the transporter's (SMTP) configuration, another for the e-mail sending settings, and a last one for the database. The final JSON file should look like this.

```json
{
    "transporter": {
        "pool": true,
        "host": "mail.example.tld",
        "port": 587,
        "requireTLS": true,
        "auth": {
            "user": "<EMAIL>",
            "pass": "<PASSWORD>"
        }
    },
    "mail": {
        "from": "My awesome service <<EMAIL>>",
        "userAgent": "Hermes (Trancendances) based on nodemailer",
        "replyTo": "<EMAIL>"
    },
    "db": {
        "mysql": {
            "host"     : "localhost",
            "user"     : "root",
            "password" : "<PASSWORD>",
            "database" : "hermes"
        }
    }
    
}
```

* The first part (`transporter`) can include any setting allowed by [nodemailer](https://github.com/nodemailer/nodemailer#set-up-smtp).
* The `mail` part configures static parts for all the e-mails that will be sent from Hermes. Right now, it only accepts three different fields: `from` (sender's address), `userAgent` (sender's user agent) and `replyTo` (the user to reply to the email, in case it differs from the sender's address).
* `db` contains all your database settings. It contains a map which key defines the database engine you use, among all the drivers existing in the application. In this example, we use MySQL, for which we use four fields: `host`, `user`, `password` and `database`.

### Available database drivers

Here is a list of all the database engines currently supported in Hermes:

**MySQL**
```json
"mysql": {
    "host"     : "localhost",
    "user"     : "root",
    "password" : "<PASSWORD>",
    "database" : "hermes"
}
```


## Starting

To start Hermes, run 
```
npm start
```
from the directory you installed it in. Hermes will run on port 1708 by default,
but you can override this value with the `PORT` environment variable.
```
PORT=8080 npm start
```

## Testing

To run Hermes's unit test, you first need to install it and its dependencies, then run 
```
npm test
```

## Contribute

If you like this project and want to help, there's many way to do it.

- Suggest new features in an [issue](https://github.com/Trancendances/hermes/issues)
- Report every bug or inconvenience you encountered during this software in the [issues](https://github.com/Trancendances/hermes/issues)
- Pick up an [issue](https://github.com/Trancendances/hermes/issues) and fix it by submitting a [pull request](https://github.com/Trancendances/hermes/pulls)
- Implement a new database driver
- Start implementing a new feature you'd like to use in the software*

\* Before you start implementing anything, please make sure to create an [issue](https://github.com/Trancendances/hermes/issues) about it if one hasn't been created yet.
{'fraction_non_alphanumeric': 0.10791117279666898, 'fraction_numerical': 0.003296321998612075, 'mean_word_length': 3.8202341137123748, 'pattern_counts': {'":': 15, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 21, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3533342', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1631, 'n_words': 694}