<commit_before>MailSlurper-Go
==============

Simple mail SMTP server that slurps mail into oblivion! Useful only for local development
MailSlurper runs on port 8000 (though it can be changed) and listens for outgoing mail send
requests. When one is received the mail item is stored in a local SQLite database.

To view the mail items that were slurped up you can open your web browser and go
to the address *http://localhost:8080* (note that this port can be changed too).

Requirements (to build)
-----------------------
* Google Go (http://golang.org/)

Requirements (to run)
---------------------
* An operating system (Windows, Mac OS X, Linux, FreeBSD)
* A modern browser (Chrome, Firefox)

How to Build
------------
Assuming you have Go installed on your system and your GOPATH environment
variable setup, place this source code, the whole **mailslurper** folder,
in *$GOPATH/src/github.com/adampresley*.

Once you've done this open up a terminal and execute the following:

```bash
$ go install github.com/adampresley/mailslurper
```

Executing the above will create an executable for your OS/platform
into the *$GOPATH/bin* folder. Here you may want to create a folder
somewhere easily accessible. Copy the following items to this new folder.

* *$GOPATH/bin/mailslurper* (mailslurper.exe on Windows)
* *$GOPATH/src/github.com/adampresley/mailslurper/www*

How to Run
----------
From a terminal:

* Windows: mailslurper.exe
* Linux: ./mailslurper

To see what options are available on the terminal execute the following:

```bash
$ ./mailslurper -help
```

The following options are available.

* **-smtpport** - Port number to bind to for the SMTP server. Defaults to 8000
* **-smtpaddress** - Address to bind the SMTP server to. Defaults to **127.0.0.1**
* **-wwwport** - Port number to bind to for the web-based administrator. Defaults to 8080
* **-www** - Path to the web administrator directory. Defaults to **www/**

So, for example, to run MailSlurper on different ports, try this.

```bash
$ ./mailslurper -smtpport=2500 -wwwport=8083
```

Configuration
-------------
MailSlurper can be configured by providing settings in a file called **config.json**.
This is a text-based file with a JSON structure in it containing four configuration
settings. It looks like this.

```javascript
{
	"www": "www/",
	"wwwPort": 8080,
	"smtpAddress": "127.0.0.1",
	"smtpPort": 8000
}
```

* **www** - Path to the web administrator directory.
* **wwwPort** - Port number to bind to for the web-based administrator.
* **smtpAddress** - Address to bind the SMTP server to.
* **smtpPort** - Port number to bind to for the SMTP server.

Please note that these provide MailSlurper the settings it needs to run and the file
must be configured properly for the application to function. Also note that if you
provide command line flag settings when running the server these configuration
values will be superceded by the command line flags.

Documentation
-------------
Wanna see the documentation? Open up a terminal and try the following (Linux. Windows will vary slightly).

```bash
$ cd $GOPATH
$ godoc -http=:6060
```

Then open up your favorite browser to *http://localhost:6060* and you will see a Go page.
Click on the button named **Packages** at the top, and you will be presented with
a list of packages. Find **github.com** and under that you will find the path **adampresley/mailslurper**.
The package documentation is all there.

Release Notes
-------------

**2014-06-02**
* Rewrote the mail header and body parsing routine.
* Attachments are now parsed correctly, stored, and can be viewed from the interface
* Body contents are no longer stored with the mail item row. They are retrieved on demain (when clicking on the row)
* Added a favicon

**2014-05-05**
* Mails that contain HTML or are multipart text and HTML now display HTML in the viewer
* Added ability to search the subject and bodies of mails to filter mail list
* Added sorting of mail items
* Addressed a date parsing issue with mails that have the timezone wrapped in parentheses
* Addressed browser resize issue. Layout now is resizable and more responsive
* Removed unneeded code
* Updated several libraries

**2013-12-15**
* Added new interface to the administrator to change settings to *config.json*
* Some code cleanup

**2013-12-12**
* Options can now be configured through settings in a file named *config.json*

**2013-12-11**
* New command line flag **-smtpaddress** allows you to specify address to bind the SMTP server to

**2013-12-06**<commit_msg>Updated README with latest release notes<commit_after>MailSlurper-Go
==============

Simple mail SMTP server that slurps mail into oblivion! Useful only for local development
MailSlurper runs on port 8000 (though it can be changed) and listens for outgoing mail send
requests. When one is received the mail item is stored in a local SQLite database.

To view the mail items that were slurped up you can open your web browser and go
to the address *http://localhost:8080* (note that this port can be changed too).

Requirements (to build)
-----------------------
* Google Go (http://golang.org/)

Requirements (to run)
---------------------
* An operating system (Windows, Mac OS X, Linux, FreeBSD)
* A modern browser (Chrome, Firefox)

How to Build
------------
Assuming you have Go installed on your system and your GOPATH environment
variable setup, place this source code, the whole **mailslurper** folder,
in *$GOPATH/src/github.com/adampresley*.

Once you've done this open up a terminal and execute the following:

```bash
$ go install github.com/adampresley/mailslurper
```

Executing the above will create an executable for your OS/platform
into the *$GOPATH/bin* folder. Here you may want to create a folder
somewhere easily accessible. Copy the following items to this new folder.

* *$GOPATH/bin/mailslurper* (mailslurper.exe on Windows)
* *$GOPATH/src/github.com/adampresley/mailslurper/www*

How to Run
----------
From a terminal:

* Windows: mailslurper.exe
* Linux: ./mailslurper

To see what options are available on the terminal execute the following:

```bash
$ ./mailslurper -help
```

The following options are available.

* **-smtpport** - Port number to bind to for the SMTP server. Defaults to 8000
* **-smtpaddress** - Address to bind the SMTP server to. Defaults to **127.0.0.1**
* **-wwwport** - Port number to bind to for the web-based administrator. Defaults to 8080
* **-www** - Path to the web administrator directory. Defaults to **www/**

So, for example, to run MailSlurper on different ports, try this.

```bash
$ ./mailslurper -smtpport=2500 -wwwport=8083
```

Configuration
-------------
MailSlurper can be configured by providing settings in a file called **config.json**.
This is a text-based file with a JSON structure in it containing four configuration
settings. It looks like this.

```javascript
{
	"www": "www/",
	"wwwPort": 8080,
	"smtpAddress": "127.0.0.1",
	"smtpPort": 8000
}
```

* **www** - Path to the web administrator directory.
* **wwwPort** - Port number to bind to for the web-based administrator.
* **smtpAddress** - Address to bind the SMTP server to.
* **smtpPort** - Port number to bind to for the SMTP server.

Please note that these provide MailSlurper the settings it needs to run and the file
must be configured properly for the application to function. Also note that if you
provide command line flag settings when running the server these configuration
values will be superceded by the command line flags.

Documentation
-------------
Wanna see the documentation? Open up a terminal and try the following (Linux. Windows will vary slightly).

```bash
$ cd $GOPATH
$ godoc -http=:6060
```

Then open up your favorite browser to *http://localhost:6060* and you will see a Go page.
Click on the button named **Packages** at the top, and you will be presented with
a list of packages. Find **github.com** and under that you will find the path **adampresley/mailslurper**.
The package documentation is all there.

Release Notes
-------------

**2014-06-04**
* MailSlurper now supports storing mail and attachments in one of three engines:
   * SQlite
   * MySQL
   * Microsoft SQL Server 2008+

**2014-06-02**
* Rewrote the mail header and body parsing routine.
* Attachments are now parsed correctly, stored, and can be viewed from the interface
* Body contents are no longer stored with the mail item row. They are retrieved on demain (when clicking on the row)
* Added a favicon

**2014-05-05**
* Mails that contain HTML or are multipart text and HTML now display HTML in the viewer
* Added ability to search the subject and bodies of mails to filter mail list
* Added sorting of mail items
* Addressed a date parsing issue with mails that have the timezone wrapped in parentheses
* Addressed browser resize issue. Layout now is resizable and more responsive
* Removed unneeded code
* Updated several libraries

**2013-12-15**
* Added new interface to the administrator to change settings to *config.json*
* Some code cleanup

**2013-12-12**
* Options can now be configured through settings in a file named *config.json*

**2013-12-11**
* New command line flag **-smtpaddress** allows you to specify address to bind the SMTP server to

**2013-12-06**
{'fraction_non_alphanumeric': 0.10444372364579954, 'fraction_numerical': 0.022921396907773815, 'mean_word_length': 3.825247782994262, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 20, 'xml': 0}, 'pii_count': 4, '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': '6041147', 'n_tokens_mistral': 2817, 'n_tokens_neox': 2543, 'n_words': 1287}