DEV Community

Cover image for create a fake webmail with roundcube like mailtrap
Roberto Manchado
Roberto Manchado

Posted on • Edited on

2

create a fake webmail with roundcube like mailtrap

you can use a fake webmail for catch your emails from
a smtp docker server. Like mailtrap.io

first of all, you need use the image:eaudeweb/mailtrap
in your docker-compose file.

Then you can config the mapping of ports and the enviroments
variables for access.

As follow:



 mail:
    container_name: sys_mail
    restart: unless-stopped
    image: eaudeweb/mailtrap
    ports:
      - "8125:80"
      - "2525:25"
    environment:
      - MT_USER=mailtrap
      - MT_PASSWD=mailtrap
      - MT_MAILBOX_LIMIT=512000001
      - MT_MESSAGE_LIMIT=102400001
    networks:
      orion-office-network:
        ipv4_address: 172.16.4.3


Enter fullscreen mode Exit fullscreen mode

Very important your address network! because
your enviroment variable for you should be the address of your container address:

this



###> symfony/mailer ###
MAILER_DSN=smtp://172.16.4.3:25?verify_peer=0
###< symfony/mailer ###


Enter fullscreen mode Exit fullscreen mode

you can acces to the admin-panel in :



172.16.4.3:80

user:mailtrap # MT_USER enviroment variables
pass:mailtrap # MT_PASSWD enviroment variables


Enter fullscreen mode Exit fullscreen mode

Other important thing is the ?verify_peer parameter
by default with value true.

if you have problems with the TLS Peers, you can
disabled only for debug . TLS Peer verification

Round-Cube-Panel-Admin

Thanks friends of Eau de web

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (2)

Collapse
 
insolita profile image
Insolita

Thanks, Is it works ok with embedded images?
I've used mailhog github.com/mailhog/MailHog and it has problems with that

Collapse
 
robertomanchado profile image
Roberto Manchado • Edited

Of course, but you should have careful with the network because de smtp is inside container

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay