The document discusses Mailcatcher, an open source tool that allows developers to catch mail sent by their applications during development. Mailcatcher runs a local SMTP server and web interface that instantly displays sent emails, avoiding issues with latency, internet dependence, and costs associated with using live mail servers during development. It provides a simple way to test email features without needing to send real emails. The document outlines how to install Mailcatcher and configure a Symfony application to use it for local email testing.
3. federico.panini@fazland.com - CTO
& symfony
The problem we faced over the last months was we’re using in dev and
stage environment as mail server the one from our hosting provider…
Mailcatcher
4. federico.panini@fazland.com - CTO
& symfony
for months we faced these problems :
time latency : we were forced to wait for the emails to come into our inbox
seconds / minutes / .. sometimes hours..
internet : as we were sending through our real mail server, sometimes we
were flooding it causing a late in the email delivery
internet : we need an internet connection to test our platform on our dev
environment
hosting provider : we had different problems related to the low quality of our
mail server provider
Mailcatcher
5. federico.panini@fazland.com - CTO
& symfony
then we decided to move our mail server to Google fo Business
dedicated email account : we create a dev account as test@fazland.com
this solution cost us MONEY, as real accounts on Google are billed monthly
limitation : the google mail server as a standard policy as a limitation in
sending no more than 500 emails per hour. Testing massive email sending
lead us to some problems
internet : we need an internet connection to test our platform on our dev
environment
Mailcatcher
6. federico.panini@fazland.com - CTO
& symfony
ok so Google worked better but it was clear that was not a real / clear
solution for the DEVS of Fazland…
What we wanted :
1. Fast email : reading / checking quickly emails sent.
2. Free : a solution without costs
3. internet : we want to tests email without having an internet connection
Mailcatcher
9. federico.panini@fazland.com - CTO
& symfony
What’s Mailcatcher (http://mailcatcher.me/) ?
MailCatcher runs a super simple SMTP server which catches any message
sent to it to display in a web interface. Run mailcatcher, set your favourite
app to deliver to smtp://127.0.0.1:1025 instead of your default SMTP server,
then check out http://127.0.0.1:1080 to see the mail that's arrived so far.
Mailcatcher
10. federico.panini@fazland.com - CTO
& symfony
Mailcatcher
Catches all mail and stores it for display.
Shows HTML, Plain Text and Source version of messages, as applicable.
Rewrites HTML enabling display of embedded, inline images/etc and open
links in a new window.
Lists attachments and allows separate downloading of parts.
Download original email to view in your native mail client(s).
Command line options to override the default SMTP/HTTP IP and port settings.
Mail appears instantly if your browser supports WebSockets, otherwise updates
every thirty seconds.
Runs as a daemon run in the background.
Sendmail-analogue command, catchmail, makes using mailcatcher from
PHP a lot easier.
Written super-simply in EventMachine, easy to dig in and change.
Keyboard navigation between messages
13. federico.panini@fazland.com - CTO
install
Mailcatcher after start will be available on port 25 as SMTP server and on
port 1080 as WEB mail client to check the email sent through the
application.
localhost 25 — SMTP
http://localhost:1080 — SMTP
Mailcatcher
15. federico.panini@fazland.com - CTO
bonus
Setup mailcatcher to boot at startup
Mailcatcher
create a file /etc/init/mailcatcher.conf
start on runlevel [2345]
stop on runlevel [!2345]
exec /usr/bin/env $(which mailcatcher) --foreground --http-ip=0.0.0.0
16. federico.panini@fazland.com - CTO
bonus
sudo service mailcatcher start
sudo service mailcatcher stop
sudo service mailcatcher restart
sudo service mailcatcher status
Mailcatcher