diff --git a/dockerfiles/email-forwarder/install.sh b/dockerfiles/email-forwarder/install.sh index cccf990..61769d5 100755 --- a/dockerfiles/email-forwarder/install.sh +++ b/dockerfiles/email-forwarder/install.sh @@ -42,3 +42,6 @@ cp /data/hostname /etc/mailname #put your forwarding addresses in /data/forwards. cp /data/forwards /etc/postfix/virtual /usr/sbin/postconf -e "virtual_alias_maps = hash:/etc/postfix/virtual" + +# accept mails from docker networked machines: +/usr/sbin/postconf -e "mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.17.42.0/24" diff --git a/dockerfiles/services/apache/Dockerfile b/dockerfiles/services/apache/Dockerfile index 74b2ed4..b91b531 100644 --- a/dockerfiles/services/apache/Dockerfile +++ b/dockerfiles/services/apache/Dockerfile @@ -14,17 +14,21 @@ RUN apt-get update \ php5-gd \ php5-mysql \ php5-xmlrpc \ + ssmtp \ && rm -rf /var/lib/apt/lists/* # Add image configuration and scripts ADD default.conf /etc/apache2/sites-enabled/000-default.conf ADD run.sh /run.sh -RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini \ +RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini && \ + sed -i "s/.*sendmail_path.*/sendmail_path = \/usr\/sbin\/ssmtp -t/g" /etc/php5/apache2/php.ini \ && mkdir -p /app \ && rm -rf /var/www/html \ && ln -s /app /var/www/html \ && a2enmod rewrite \ && chmod 755 /run.sh +COPY ssmtp.conf /etc/ssmtp/ssmtp.conf + CMD ["/run.sh"] EXPOSE 80 diff --git a/dockerfiles/services/apache/ssmtp.conf b/dockerfiles/services/apache/ssmtp.conf new file mode 100644 index 0000000..aa6b53b --- /dev/null +++ b/dockerfiles/services/apache/ssmtp.conf @@ -0,0 +1,4 @@ +mailhub=172.17.42.1 +root=postmaster +FromLineOverride=YES +