Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending mail #204

Open
thibodelanghe opened this issue Jun 17, 2020 · 8 comments · May be fixed by #288
Open

Sending mail #204

thibodelanghe opened this issue Jun 17, 2020 · 8 comments · May be fixed by #288
Labels
enhancement Work on new feature (or any question related to new feature)
Milestone

Comments

@thibodelanghe
Copy link

Expected Behavior

Email is being sent.

Current Behavior

Email isn't being sent.

Context

When i use the mail() function the email isn't being sent. I have a postfix container running and want to use that to send email. How can i do this with this image?

Your Environment

webserver container with image php:7.4-v3-apache
postfix container

@moufmouf
Copy link
Member

Did you configure the SMTP option of php.ini to point to your postfix container (using the PHP_INI_SMTP environment variable?)

@thibodelanghe
Copy link
Author

thibodelanghe commented Jun 23, 2020 via email

@moqmar
Copy link

moqmar commented Sep 13, 2020

Hm, doesn't work for me. What about adding something like DMA to the image & then allowing to set the SMTP details through environment variables?

Edit: DMA doesn't even need to be configured to send email - the simplest way to set up sending email with it would be the following in a custom Dockerfile:

USER 0
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y dma
USER 1000
ENV PHP_INI_SENDMAIL_PATH "/usr/sbin/sendmail -t -i [email protected]"

That being said, I'd really like this to support fully configuring DMA through environment variables, e.g. [email protected], DMA_CONF_SMARTHOST=smtp.postmarkapp.com DMA_CONF_STARTTLS=true, DMA_AUTH_USERNAME & DMA_AUTH_PASSWORD.

DMA_FROM would set the php.ini option, DMA_CONF_* would set the corresponding entry in dma.conf and DMA_AUTH_* would set username and password in auth.conf.

moqmar added a commit to moqmar/docker-images-php that referenced this issue Oct 16, 2020
@moqmar
Copy link

moqmar commented Oct 16, 2020

I've installed DMA & added documentation, but parsing the environment variables & generating the configuration is still to be done - I'll probably get that done in the next couple of days.

@moqmar moqmar mentioned this issue Oct 28, 2020
6 tasks
moqmar added a commit to moqmar/docker-images-php that referenced this issue Oct 30, 2020
@mistraloz
Copy link
Collaborator

I try to make any enhancements in this repo (and first i have to clean PR). I'm sorry because you worked a lot on this PR but i'm not sure this docker image have to act like SMTP server. There is lot of docker image who do that.
Could you give me some use cases where the implementation of an smtp is required ?

@mistraloz mistraloz added the need more information Further information is requested label Sep 21, 2021
@stale
Copy link

stale bot commented Nov 20, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please update it if any action still required.

@stale stale bot added the stale Issues inactives for a while (automatically) label Nov 20, 2021
@stale
Copy link

stale bot commented Nov 27, 2021

This issue has been automatically closed because it has not had recent activity. Please, reopen if you need.

@stale stale bot closed this as completed Nov 27, 2021
@moqmar
Copy link

moqmar commented Feb 1, 2022

DMA doesn't really act like a full SMTP server - without anything, it just acts like the sendmail command usually does, so it sends the email directly to the recipient SMTP server. With configuration, it can be used to relay sendmail to a specified SMTP server (like your ISP, or Sendgrid, etc.).
Without any sendmail-like command installed, it's AFAIK basically impossible to use the mail() function with this image, which many PHP applications rely on. I'll try to get the PR up to date in the next days & will try if it finally works.

@mistraloz mistraloz added this to the V4 milestone Feb 1, 2022
@mistraloz mistraloz added enhancement Work on new feature (or any question related to new feature) and removed stale Issues inactives for a while (automatically) need more information Further information is requested labels Feb 1, 2022
@mistraloz mistraloz reopened this Feb 1, 2022
moqmar added a commit to moqmar/docker-images-php that referenced this issue Feb 7, 2022
@moqmar moqmar linked a pull request Feb 7, 2022 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Work on new feature (or any question related to new feature)
Projects
None yet
4 participants