-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renamed MailTrap -> Sendria due to conflict with mailtrap.io
- Loading branch information
1 parent
3441d3d
commit c9ac80e
Showing
59 changed files
with
250 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
FROM python:3.8-slim-buster | ||
MAINTAINER Marcin Sztolcman <[email protected]> | ||
|
||
RUN useradd --create-home mailtrap | ||
WORKDIR /home/mailtrap | ||
USER mailtrap | ||
RUN python3 -m pip install --user mailtrap==1.0.0 | ||
RUN useradd --create-home sendria | ||
WORKDIR /home/sendria | ||
USER sendria | ||
RUN python3 -m pip install --user sendria==1.0.0 | ||
|
||
EXPOSE 1025 1080 | ||
|
||
CMD ["/home/mailtrap/.local/bin/mailtrap", "--foreground", "--db=./mails.sqlite", "--smtp-ip=0.0.0.0", "--http-ip=0.0.0.0"] | ||
CMD ["/home/sendria/.local/bin/sendria", "--foreground", "--db=./mails.sqlite", "--smtp-ip=0.0.0.0", "--http-ip=0.0.0.0"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
include LICENSE | ||
graft mailtrap/templates | ||
graft mailtrap/static | ||
graft sendria/templates | ||
graft sendria/static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
MailTrap | ||
Sendria | ||
========== | ||
|
||
[](https://pypi.python.org/pypi/mailtrap) | ||
[](https://pypi.python.org/pypi/mailtrap) | ||
[](https://pypi.python.org/pypi/mailtrap) | ||
[](https://pypi.python.org/pypi/sendria) | ||
[](https://pypi.python.org/pypi/sendria) | ||
[](https://pypi.python.org/pypi/sendria) | ||
[](https://saythanks.io/to/marcin%40urzenia.net) | ||
|
||
MailTrap is a SMTP server designed to run in your dev/test environment, that is designed to catch any email you | ||
Sendria (formerly MailTrap) is a SMTP server designed to run in your dev/test environment, that is designed to catch any email you | ||
or your application is sending, and display it in a web interface instead of sending to real world. | ||
It help you prevents sending any dev/test emails to real people, no matter what address you provide. | ||
Just point your app/email client to `smtp://127.0.0.1:1025` and look at your emails on `http://127.0.0.1:1080`. | ||
|
||
MailTrap is built on shoulders of: | ||
Sendria is built on shoulders of: | ||
* [MailCatcher](https://mailcatcher.me/) - original idea comes of this tool by Samuel Cochran. | ||
* [MailDump](https://github.com/ThiefMaster/maildump) - base source code of `MailTrap` (version pre 1.0.0), by Adrian Mönnich. | ||
* [MailDump](https://github.com/ThiefMaster/maildump) - base source code of `Sendria` (version pre 1.0.0), by Adrian Mönnich. | ||
|
||
If you like this tool, just [say thanks](https://saythanks.io/to/marcin%40urzenia.net). | ||
|
||
|
@@ -42,58 +42,58 @@ Features | |
Installation | ||
------------ | ||
|
||
`MailTrap` should work on any POSIX platform where [Python](http://python.org) | ||
`Sendria` should work on any POSIX platform where [Python](http://python.org) | ||
is available, it means Linux, MacOS/OSX etc. | ||
|
||
Simplest way is to use Python's built-in package system: | ||
|
||
python3 -m pip install mailtrap | ||
python3 -m pip install sendria | ||
|
||
You can also use [pipx](https://pipxproject.github.io/pipx/) if you don't want to | ||
mess with system packages and install `MailTrap` in virtual environment: | ||
mess with system packages and install `Sendria` in virtual environment: | ||
|
||
pipx install mailtrap | ||
pipx install sendria | ||
|
||
Voila! | ||
|
||
Python version | ||
-------------- | ||
|
||
`MailTrap` is tested against Python 3.7+. Older Python versions may work, or may not. | ||
`Sendria` is tested against Python 3.7+. Older Python versions may work, or may not. | ||
|
||
If you want to run this software on Python 2.6+, just use [MailDump](https://github.com/ThiefMaster/maildump). | ||
|
||
How to use | ||
---------- | ||
|
||
[After installing](#installation) `MailTrap`, just run command: | ||
[After installing](#installation) `Sendria`, just run command: | ||
|
||
mailtrap --db mails.sqlite | ||
sendria --db mails.sqlite | ||
|
||
Now send emails through `smtp://127.0.0.1:1025`, ie.: | ||
|
||
```shell | ||
echo 'From: MailTrap <mailtrap@example.com>\n'\ | ||
echo 'From: Sendria <sendria@example.com>\n'\ | ||
'To: You <[email protected]>\n'\ | ||
'Subject: Welcome!\n\n'\ | ||
'Welcome to MailTrap!' | \ | ||
curl smtp://localhost:1025 --mail-from mailtrap@example.com \ | ||
'Welcome to Sendria!' | \ | ||
curl smtp://localhost:1025 --mail-from sendria@example.com \ | ||
--mail-rcpt [email protected] --upload-file - | ||
``` | ||
|
||
And finally look at `MailTrap` GUI on [127.0.0.1:1080](http://127.0.0.1:1080). | ||
And finally look at `Sendria` GUI on [127.0.0.1:1080](http://127.0.0.1:1080). | ||
|
||
If you want more details, run: | ||
|
||
mailtrap --help | ||
sendria --help | ||
|
||
for more info, ie. how to protect access to gui. | ||
|
||
|
||
API | ||
--- | ||
|
||
`MailTrap` offers RESTful API you can use to fetch list of messages or particular message, ie. for testing purposes. | ||
`Sendria` offers RESTful API you can use to fetch list of messages or particular message, ie. for testing purposes. | ||
|
||
You can use excellent [httpie](https://httpie.org/) tool: | ||
|
||
|
@@ -103,7 +103,7 @@ HTTP/1.1 200 OK | |
Content-Length: 620 | ||
Content-Type: application/json; charset=utf-8 | ||
Date: Wed, 22 Jul 2020 20:04:46 GMT | ||
Server: MailTrap/1.0.0 (https://github.com/msztolcman/mailtrap) | ||
Server: Sendria/1.0.0 (https://github.com/msztolcman/sendria) | ||
|
||
{ | ||
"code": "OK", | ||
|
@@ -120,10 +120,10 @@ Server: MailTrap/1.0.0 (https://github.com/msztolcman/mailtrap) | |
"recipients_message_to": [ | ||
"You <[email protected]>" | ||
], | ||
"sender_envelope": "mailtrap@example.com", | ||
"sender_message": "MailTrap <mailtrap@example.com>", | ||
"sender_envelope": "sendria@example.com", | ||
"sender_message": "Sendria <sendria@example.com>", | ||
"size": 191, | ||
"source": "From: MailTrap <mailtrap@example.com>\nTo: You <[email protected]>\nSubject: Welcome!\nX-Peer: ('127.0.0.1', 59872)\nX-MailFrom: mailtrap@example.com\nX-RcptTo: [email protected]\n\nWelcome to MailTrap!\n", | ||
"source": "From: Sendria <sendria@example.com>\nTo: You <[email protected]>\nSubject: Welcome!\nX-Peer: ('127.0.0.1', 59872)\nX-MailFrom: sendria@example.com\nX-RcptTo: [email protected]\n\nWelcome to Sendria!\n", | ||
"subject": "Welcome!", | ||
"type": "text/plain" | ||
} | ||
|
@@ -146,11 +146,11 @@ There are available endpoints: | |
Docker | ||
------ | ||
|
||
There is also available [Docker image of MailTrap](https://hub.docker.com/layers/msztolcman/mailtrap/). | ||
There is also available [Docker image of Sendria](https://hub.docker.com/layers/msztolcman/sendria/). | ||
If you want to try, just run: | ||
|
||
```shell | ||
docker run -p 1025:1025 -p 1080:1080 msztolcman/mailtrap | ||
docker run -p 1025:1025 -p 1080:1080 msztolcman/sendria | ||
``` | ||
|
||
Help! | ||
|
@@ -172,7 +172,7 @@ For your rails application just set in your `environments/development.rb`: | |
Configure Django | ||
---------------- | ||
|
||
To configure Django to work with `MailTrap`, add the following to your projects' `settings.py`: | ||
To configure Django to work with `Sendria`, add the following to your projects' `settings.py`: | ||
|
||
if DEBUG: | ||
EMAIL_HOST = '127.0.0.1' | ||
|
@@ -184,20 +184,20 @@ To configure Django to work with `MailTrap`, add the following to your projects' | |
Behind nginx | ||
------------ | ||
|
||
If you want to hide `MailTrap` behind nginx (ie. to terminate ssl) then you can [use example | ||
config (see in addons)](https://github.com/msztolcman/mailtrap/tree/master/addons/nginx.conf). | ||
If you want to hide `Sendria` behind nginx (ie. to terminate ssl) then you can [use example | ||
config (see in addons)](https://github.com/msztolcman/sendria/tree/master/addons/nginx.conf). | ||
|
||
Supervisord | ||
----------- | ||
|
||
To start `Mailtrap` automatically with [Supervisor](https://supervisord.org/) there is in | ||
[addons example config file for this purpose](https://github.com/msztolcman/mailtrap/tree/master/addons/supervisor.conf). | ||
To start `Sendria` automatically with [Supervisor](https://supervisord.org/) there is in | ||
[addons example config file for this purpose](https://github.com/msztolcman/sendria/tree/master/addons/supervisor.conf). | ||
|
||
Authors | ||
------- | ||
|
||
* Marcin Sztolcman ([[email protected]](mailto:[email protected])) | ||
* Adrian Mönnich (author of [MailDump](https://github.com/ThiefMaster/maildump), base of `MailTrap`) | ||
* Adrian Mönnich (author of [MailDump](https://github.com/ThiefMaster/maildump), base of `Sendria`) | ||
|
||
Contact | ||
------- | ||
|
@@ -206,30 +206,30 @@ If you like or dislike this software, please do not hesitate to tell me about | |
this me via email ([[email protected]](mailto:[email protected])). | ||
|
||
If you find bug or have an idea to enhance this tool, please use GitHub's | ||
[issues](https://github.com/msztolcman/mailtrap/issues). | ||
[issues](https://github.com/msztolcman/sendria/issues). | ||
|
||
ChangeLog | ||
--------- | ||
|
||
### v1.0.0 | ||
|
||
* complete rewrite of backend part. MailTrap is using [asyncio](https://docs.python.org/3/library/asyncio.html) and | ||
* complete rewrite of backend part. Sendria is using [asyncio](https://docs.python.org/3/library/asyncio.html) and | ||
[aio-libs](https://github.com/aio-libs/) now: | ||
* switch to [aiohttp](https://docs.aiohttp.org/) from Flask | ||
* switch to [aiosmtpd](https://aiosmtpd.readthedocs.io) from [smtpd](https://docs.python.org/3/library/smtpd.html) | ||
* switch to [aiosqlite](https://github.com/omnilib/aiosqlite) from [sqlite3](https://docs.python.org/3/library/sqlite3.html) | ||
* changed logger to [structlog](https://www.structlog.org/) | ||
* using asynchronous version of libraries drastically improved performance | ||
* `MailTrap` now can send a webhook about every received message | ||
* `Sendria` now can send a webhook about every received message | ||
* show in GUI information about envelope sender and recipients | ||
* all API requests has their own namespace now: `/api` | ||
* allow to replace name of application or url in template | ||
* block truncating all messages from GUI (on demand) | ||
* fixed issues with `WebSockets`, should refresh mails list and reconnect if disconnected | ||
* fixed issues with autobuilding assets | ||
* many cleanups and reformatting code | ||
* addons for [nginx](https://github.com/msztolcman/mailtrap/tree/master/addons/nginx.conf) | ||
and [supervisor](https://github.com/msztolcman/mailtrap/tree/master/addons/supervisor.conf) | ||
* addons for [nginx](https://github.com/msztolcman/sendria/tree/master/addons/nginx.conf) | ||
and [supervisor](https://github.com/msztolcman/sendria/tree/master/addons/supervisor.conf) | ||
|
||
#### Backward incompatible changes: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#!/usr/bin/env python3 | ||
# This is a small utility to run mailtrap during development without installing it first. | ||
# This is a small utility to run sendria during development without installing it first. | ||
|
||
import asyncio | ||
|
||
|
||
if __name__ == '__main__': | ||
import mailtrap.cli | ||
# asyncio.run(mailtrap.cli.main()) | ||
mailtrap.cli.main() | ||
import sendria.cli | ||
# asyncio.run(sendria.cli.main()) | ||
sendria.cli.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from sendria.cli import main | ||
|
||
main() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.