Jump to content

Emails are not sending from docker container on revive version 5.4


Recommended Posts

Emails are not sending from docker container on revive version 5.4

I am currently attempting to set up a revive adserver 5.4 installation inside an alpine docker container, the installation runs smoothly and everything seems to be working correctly. The issue arises when creating a new user, I am prompted that the user will receive an email to complete setting up their account however no email is ever received by the user.

To my understanding revive uses the normal php mail function and I have tested sending a mail both through msmtp and using phps mail function and both are able to send emails.

Is there more setup required in order to send mails from revive? Any help would be greatly appreciated.

The following is my dockerfile:

FROM alpine
MAINTAINER jdhawk <jdhawk@dh0.net>

WORKDIR /var/www/html

RUN apk --update upgrade && apk update && apk add curl ca-certificates && update-ca-certificates --fresh && apk add openssl && apk add msmtp && touch /etc/msmtprc

RUN apk --update add \
    --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
    --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
        nginx \
        gzip \
        php7 \
        php7-dom \
        php7-ctype \
        php7-curl \
        php7-fpm \
        php7-gd \
        php7-intl \
        php7-json \
        php7-mbstring \
        php7-mcrypt \
        php7-mysqli \
        php7-mysqlnd \
        php7-opcache \
        php7-pdo \
        php7-pdo_mysql \
        php7-posix \
        php7-session \
        php7-xml \
        php7-iconv \
        php7-phar \
        php7-openssl \
        php7-zlib \
        php7-zip \
    && rm -rf /var/cache/apk/*

RUN wget -qO- https://download.revive-adserver.com/revive-adserver-5.4.0.tar.gz | tar xz --strip 1 \
    && chown -R nobody:nobody . \
    && rm -rf /var/cache/apk/*

COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY ssmtp/msmtprc /etc/msmtprc
COPY php/msmtp.ini /etc/php7/conf.d/msmtp.ini

RUN chmod 600 /etc/msmtprc

RUN mkdir -p /run/nginx

EXPOSE 80

CMD php-fpm7 && nginx -g 'daemon off;'

The following is my msmtprc file:

account default
host smtp.gmail.com
port 587
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
tls_certcheck off
auth on
user [my email]@gmail.com
password [my app password]
from [my email]@gmail.com
logfile /var/log/msmtp.log

The following is my msmtp.iniĀ  file:

sendmail_path = /usr/bin/msmtp -t

The following are the two mail commands that run successfully:

echo -e "Subject: Test Mail\r\n\r\nThis is a test mail, let me know if this works" |msmtp --debug --from [me@email.com] -t [to@email.com]

php7 -r "mail('[to@email.com]','Test Mail from PHP', 'This is a test mail from PHP, let me know if this works');"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...