DEV Community

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

Posted on • Edited on

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

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