<commit_before># mailhound

Mailhound is a simple server side script for receiving form posts and emailing the form values.

## Installation

### Prerequisites

1. Create an account with a mail provider like [Mailgun](https://mailgun.com) or [Sendgrid](https://sendgrid.com) 

### Heroku Install (Free)

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/chadfawcett/mailhound)

1. Give your app a name: `blogemailsender`
2. Choose your server region: `United States`
3. Set your environment variables:
  1. **ADMIN**: Enter your email
  2. **SMTP**: Your smtp credentials
4. Deploy for **Free**!

### Digital Ocean Install ([$10 Credit](http://do.chadf.ca))

1. Create a new droplet using the Node application image
2. SSH into your newly created droplet
3. Install mailhound with `npm install -g mailhound`
4. Add config variable exports to the end of your `~/.profile` file
  1. `export SMTP=smtp://postmaster:pass@smtp.server.com`
  2. `export KEY:name@domain.com`
5. Reconnect to SSH and run the script `mailhound`

### Docker Install

1. Build the docker image with `docker build -t mailhound github.com/chadfawcett/mailhound`
2. Create a config file with your environment variables

    ```
    ADMIN=<EMAIL>.com
    SMTP=smtp://postmaster:pass@smtp.server.com
    ```

3. Run docker with `docker run --env-file=<path to the config file> -p 8000:8000 mailhound`

## Usage

### Typical Setup

```html
<form method="POST" action="http://heroku.url.com?key=ADMIN">
  <input type="text" name="name" placeholder="Name">
  <input type="email" name="_replyto" placeholder="Email">
  <textarea name="message" placeholder="Message" cols="30" rows="8"></textarea>
  <input type="submit" value="Send">
</form>
```

Make sure to update the `action` url to be your Heroku app url, and the key should be `ADMIN` or a custom key that matches your config variables.

### Main Message<commit_msg>Change Docker instructions to use Docker Hub<commit_after># mailhound

Mailhound is a simple server side script for receiving form posts and emailing the form values.

## Installation

### Prerequisites

1. Create an account with a mail provider like [Mailgun](https://mailgun.com) or [Sendgrid](https://sendgrid.com) 

### Heroku Install (Free)

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/chadfawcett/mailhound)

1. Give your app a name: `blogemailsender`
2. Choose your server region: `United States`
3. Set your environment variables:
  1. **ADMIN**: Enter your email
  2. **SMTP**: Your smtp credentials
4. Deploy for **Free**!

### Digital Ocean Install ([$10 Credit](http://do.chadf.ca))

1. Create a new droplet using the Node application image
2. SSH into your newly created droplet
3. Install mailhound with `npm install -g mailhound`
4. Add config variable exports to the end of your `~/.profile` file
  1. `export SMTP=smtp://postmaster:pass@smtp.server.com`
  2. `export KEY:name@domain.com`
5. Reconnect to SSH and run the script `mailhound`

### Docker Install

1. Create a config file with your environment variables

    ```
    ADMIN=<EMAIL>
    SMTP=smtp://postmaster:pass@smtp.server.com
    ```

2. Run docker with `docker run --env-file=<path to the config file> -p 8000:8000 chadfawcett/mailhound`

## Usage

### Typical Setup

```html
<form method="POST" action="http://heroku.url.com?key=ADMIN">
  <input type="text" name="name" placeholder="Name">
  <input type="email" name="_replyto" placeholder="Email">
  <textarea name="message" placeholder="Message" cols="30" rows="8"></textarea>
  <input type="submit" value="Send">
</form>
```

Make sure to update the `action` url to be your Heroku app url, and the key should be `ADMIN` or a custom key that matches your config variables.

### Main Message
{'fraction_non_alphanumeric': 0.1346704871060172, 'fraction_numerical': 0.015368585569158636, 'mean_word_length': 4.541125541125541, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 6, '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': '3153424', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1199, 'n_words': 430}