Package: sendria
SendriaSendria (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 tosmtp://127.0.0.1:1025and look at your emails onhttp://127.0.0.1:1080.Sendria is built on shoulders of:MailCatcher- original idea comes of this tool by Samuel Cochran.MailDump- base source code ofSendria(version pre 1.0.0), by Adrian Mönnich.If you like this tool, justsay thanks.Icon made byFreepikfromwww.flaticon.com.Current stable version2.2.2FeaturesCatch all emails and store it for display.Full support for multipart messages.View HTML and plain text parts of messages (if given part exists).View source of email.Lists attachments and allows separate downloading of parts.Download original email to view in your native mail client(s).Mail appears instantly if your browser supportsWebSockets.Optionally, send webhook on every received message.Runs as a daemon in the background, optionally in foreground.Keyboard navigation between messages.Optionally password protected access to web interface.Optionally password protected access to SMTP (SMTP AUTH).It's all Python!InstallationSendriashould work on any POSIX platform wherePythonis available, it means Linux, MacOS/OSX etc.Simplest way is to use Python's built-in package system:python3 -m pip install sendriaYou can also usepipxif you don't want to
mess with system packages and installSendriain virtual environment:pipx install sendriaVoila!Python versionSendriais 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 useMailDump.How to useAfter installingSendriajust run command:sendria --db mails.sqliteNow send emails throughsmtp://127.0.0.1:1025, i.e.:echo'From: Sendria <sendria@example.com>\n'\'To: You <you@example.com>\n'\'Subject: Welcome!\n\n'\'Welcome to Sendria!'|\curlsmtp://localhost:1025--mail-fromsendria@example.com\--mail-rcptyou@example.com--upload-file-or simpler withSMTPc:smtpcsend--hostlocalhost:1025--fromsendria@example.com--toyou@example.com\--subject'Welcome!'--body'Welcome to Sendria!'Finally, look atSendriaGUI on127.0.0.1:1080.If you want more details, run:sendria --helpfor more info, ie. how to protect access to gui.APISendriaoffers RESTful API you can use to fetch list of messages or particular message, ie. for testing purposes.You can use excellenthttpietool:%httplocalhost:1080/api/messages/
HTTP/1.1200OK
Content-Length:620Content-Type:application/json;charset=utf-8
Date:Wed,22Jul202020:04:46GMT
Server:Sendria/1.0.0(https://github.com/msztolcman/sendria){"code":"OK","data":[{"created_at":"2020-07-22T20:04:41","id":1,"peer":"127.0.0.1:59872","recipients_envelope":["you@example.com"],"recipients_message_bcc":[],"recipients_message_cc":[],"recipients_message_to":["You <you@exampl.com>"],"sender_envelope":"sendria@example.com","sender_message":"Sendria <sendria@example.com>","size":191,"source":"From: Sendria <sendria@example.com>\nTo: You <you@exampl.com>\nSubject: Welcome!\nX-Peer: ('127.0.0.1', 59872)\nX-MailFrom: sendria@example.com\nX-RcptTo: you@example.com\n\nWelcome to Sendria!\n","subject":"Welcome!","type":"text/plain"}],"meta":{"pages_total":3}}There are available endpoints:GET /api/messages/- fetch list of emails. There is one query string param:pagefor pagination.DELETE /api/messages/- delete all emailsGET /api/messages/{message_id}.json- fetch email metadataGET /api/messages/{message_id}.plain- fetch plain part of emailGET /api/messages/{message_id}.html- fetch HTML part of emailGET /api/messages/{message_id}.source- fetch source of emailGET /api/messages/{message_id}.eml- download whole email as an EML fileGET /api/messages/{message_id}/parts/{cid}- download particular attachmentDELETE /api/messages/{message_id}- delete single emailDockerThere is also availableDocker image of Sendria.
If you want to try, just run:dockerrun-p1025:1025-p1080:1080msztolcman/sendriaHelp!I'm backend developer, not a frontend guy nor designer... If you are, and want to help, justmail me!.
I think GUI should be redesigned, or at least few minor issues could be solved. Also, project requires some logo and/or icon. Again,
do not hesitate tomail meif you want and can help :)Also, if you have an idea how to enhanceSendria,please fill the ticket.
Every idea, every feature request can help you, me and others!Configure RailsFor your rails application just set in yourenvironments/development.rb:config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { :address => '127.0.0.1', :port => 1025 }
config.action_mailer.raise_delivery_errors = falseConfigure DjangoTo configure Django to work withSendria, add the following to your projects'settings.py:if DEBUG:
    EMAIL_HOST = '127.0.0.1'
    EMAIL_HOST_USER = ''
    EMAIL_HOST_PASSWORD = ''
    EMAIL_PORT = 1025
    EMAIL_USE_TLS = FalseBehind nginxIf you want to hideSendriabehind nginx (ie. to terminate ssl) then you canuse example
config (see in addons).SupervisordTo startSendriaautomatically withSupervisorthere is inaddons example config file for this purpose.AuthorsMarcin Sztolcman (marcin@urzenia.net)Adrian Mönnich (author ofMailDump, base ofSendria)ContactIf you like or dislike this software, please do not hesitate to tell me about
this me via email (marcin@urzenia.net).If you find bug or have an idea to enhance this tool, please use GitHub'sissues.ChangeLogv2.2.1updated deps in setup.pyv.2.2.0added messages pagination. One page is 100 messages. Can be browsed using
buttons next to "Search" window or keyboard shortcuts:Ctrl-Shift-[Cursor Left]orCtrl-Shift-[Cursor Right].changed keyboard shortcuts: instead ofCtrl-[Cursor Up]andCtrl-[Cursor Down]there is nowCtrl-Shift-[Cursor Up]andCtrl-Shift-[Cursor Down].allow configuring defaultSendriainstance using config file (seesendria --help->--config-file).some fixes after hints from lintersminor changes and fixesv2.1.0auth mechanisms are now implemented inaiosmtpd(thanksArzarothfor PR)huge improvements to handling DB inserts. Now all messages are stored in an internal queue,
then it's saved to the DB. It solves many problems with performance and single-threaded
SQLite (thanksKathrynNfor reporting)fixed API response when there is no data to return (#3) (
thanksKathrynNfor reporting)improved logging system, now log messages has log levels, also many simplifications in
logging systemSendria now introduce as itself when connect through SMTP (also--smtp-identCLI param added)minor fixes and performance issues solved, updated dependenciesnext step in cleanups and making code modernv2.0.1new icon (byFreepikfromwww.flaticon.com)v2.0.0rename MailTrap -> Sendriav1.0.0complete rewrite of backend part. Sendria is usingasyncioandaio-libsnow:switch toaiohttpfrom Flaskswitch toaiosmtpdfromsmtpdswitch toaiosqlitefromsqlite3changed logger tostructlogusing asynchronous version of libraries drastically improved performanceSendrianow can send a webhook about every received messageshow in GUI information about envelope sender and recipientsall API requests has their own namespace now:/apiallow to replace name of application or url in templateblock truncating all messages from GUI (on demand)fixed issues withWebSockets, should refresh mails list and reconnect if disconnectedfixed issues with autobuilding assetsmany cleanups and reformatting codeaddons fornginxandsupervisorBackward incompatible changes:all api's requests are now prefixed with/api(look atAPI section)--htpasswdcli param is renamed to--http-authv0.1.6fixed issue with old call dogevent.signalminimum gevent version set to 1.5.0v0.1.4bumped dependencies - security issues (dependabot)v0.1.3fixed layout issues (thanksradoslawhryciow)v0.1.2fixed encoding issuesv0.1.0better support for macOS/OSXlinks now opens in new tab/window (added 'target="blank"')show message if there is no assets generated and info how to to generate themadded debugs for SMTP when in debug modeadded support forPipenvHTML tab is default now when looking at particular messageconverted to support Python 3.6+, drop support for lower Python versionsadded SMTP auth support (look atpull request 28)copy fromMailDumpv0.5.6