[WIP] Utilise mailcatcher pour l'envois de mail

This commit is contained in:
2016-09-28 11:26:52 +02:00
parent 200cd26a06
commit 8a22bc22e0
5 changed files with 38 additions and 18 deletions

21
config/ssmtpd.conf Normal file
View File

@@ -0,0 +1,21 @@
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=postmaster
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=mailcatcher
# Where will the mail seem to come from?
#rewriteDomain=
# The full hostname
hostname=devphp
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

View File

@@ -21,6 +21,7 @@ php:
- ./config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
links:
- mariadb
- mailcatcher
nginx:
image: nginx:latest
@@ -36,12 +37,12 @@ nginx:
links:
- php
# smtp:
# build: ./smtp
# volumes:
# - ./config/smtpd.conf:/etc/smtpd.conf
# - ./config/mailname:/etc/mailname
# expose:
# - 25
mailcatcher:
build: ./mailcatcher
volumes:
- ./config/smtpd.conf:/etc/smtpd.conf
- ./config/mailname:/etc/mailname
expose:
- 25
ports:
- 1080:1080

5
mailcatcher/Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM ruby
RUN gem install mailcatcher
ENTRYPOINT ["mailcatcher", "-f", "--ip", "0.0.0.0", "--smtp-port", "25", "--no-quit"]

View File

@@ -7,7 +7,7 @@ RUN cd /tmp/ && \
mv xdebug-2.4.1/* /usr/src/php/ext/xdebug/
RUN apt-get update && apt-get install -y \
ssmtp \
ssmtp \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
@@ -21,5 +21,6 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY ../config/ssmtpd.conf /etc/ssmtp/ssmtp.conf
RUN docker-php-ext-install xdebug

View File

@@ -1,8 +0,0 @@
FROM debian:jessie
RUN echo "deb http://debian.mirrors.ovh.net/debian/ jessie-backports main" >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y \
opensmtpd/jessie-backports \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["/usr/sbin/smtpd", "-d"]