Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add DMA for sending email (revisit #217)#288

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
moqmar wants to merge5 commits intothecodingmachine:v4
base:v4
Choose a base branch
Loading
frommoqmar:feature/dma

Conversation

@moqmar
Copy link

Summary

Implement solution for email sending, as discussed in#204 and also attempted earlier in#217 for v3.

This PR implements the followingfeatures

  • Install DMA
  • Make DMA configurable via environment variables
  • Document DMA usage &[NEW] add tests tobuild-and-test.sh
  • [NEW] Make sure the log output of DMA is redirected to STDERR by using busybox-syslogd (unfortunately DMA can only use syslog)

Explain themotivation for making this change. What existing problem does the pull request solve?

Most PHP hosters make the "mail()" function usable, so many PHP application expect it to be usable. With this image, those applications were unable to send email.

Test plan (required)

Seebuild-and-test.sh, the commands from there can also be run manually; the mails sent with the demo credentials can be viewed onhttps://ethereal.email/messages.

# Let's check that we can send mail directlyTESTMAIL_ID_DIRECT=$RANDOMdocker run --rm -e DMA_BLOCKING=1"thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}" php -r"mail('lemuel.ratke46@ethereal.email', 'Hello World${TESTMAIL_ID_DIRECT}', 'This is an automatic test email, using a direct connection.');"# Let's check that we can send mail through a smarthost with credentials# Sending to an MCAST-TEST-NET IP address as that must not appear on the public internet according to RFC 5771, and will thus be unreachable for direct sending.TESTMAIL_ID_SMARTHOST=$RANDOMdocker run --rm -e DMA_BLOCKING=1 -e DMA_CONF_SMARTHOST=smtp.ethereal.email -e DMA_CONF_PORT=587 -e DMA_CONF_SECURETRANSFER= -e DMA_CONF_STARTTLS= -e DMA_AUTH_USERNAME=lemuel.ratke46@ethereal.email -e DMA_AUTH_PASSWORD=pjxG3kc3VR31jQUvHz"thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}" php -r"mail('lemuel.ratke46@233.252.0.0', 'Hello World${TESTMAIL_ID_SMARTHOST}', 'This is an automatic test email, using a smarthost.');"# Let's check that the mails came throughETHEREAL_COOKIEJAR=$(mktemp --tmpdir ethereal-cookies.XXXXXXXXXX)ETHEREAL_CSRF=$(curl https://ethereal.email/login -s --fail -c"${ETHEREAL_COOKIEJAR}"| grep -Pom1'\bname="_csrf" value="\K[^"]+')curl https://ethereal.email/login -s --fail -X POST --data-urlencode"address=lemuel.ratke46@ethereal.email" --data-urlencode"password=pjxG3kc3VR31jQUvHz" --data-urlencode"_csrf=${ETHEREAL_CSRF}" -b"${ETHEREAL_COOKIEJAR}" -c"${ETHEREAL_COOKIEJAR}">/dev/nullETHEREAL_INBOX=$(curl https://ethereal.email/messages -s --fail -b"${ETHEREAL_COOKIEJAR}")rm"${ETHEREAL_COOKIEJAR}"echo"${ETHEREAL_INBOX}"| grep -F">Hello World${TESTMAIL_ID_DIRECT}<"echo"${ETHEREAL_INBOX}"| grep -F">Hello World${TESTMAIL_ID_SMARTHOST}<"

Closing issues

Fixes#204

Checklist

  • Have you followed the guidelines in ourCONTRIBUTING guide?
  • I have squashed any insignificant commits
  • This change has comments for package types, values, functions, and non-obvious lines of code

@moqmar
Copy link
Author

FYI, I'm getting the same issue in the actions when runningPHP_VERSION="7.3" BRANCH="v4" VARIANT="cli" ./build-and-test.sh locally, also on the main v4 branch, so this doesn't look like it's an issue with these changes.

@mistraloz
Copy link
Collaborator

First, thx you for your PR,@moqmar. I checked and seem a good implementation for all requirement.
About the fail of CI, it's seem related to an other issue !286 (i will wait this one can be fixed to merge this PR).

I may don't have time this week to manage this issue bug the reporter said he may fix it. If not, i will try to do it at end of next week.

moqmar reacted with thumbs up emoji

@mistralozmistraloz self-requested a reviewFebruary 8, 2022 19:31
@mistralozmistraloz added the enhancementWork on new feature (or any question related to new feature) labelFeb 8, 2022
@mistralozmistraloz added this to theV4 milestoneFeb 8, 2022
@GlennM
Copy link

Are there any updates on this one? :)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@mistralozmistralozmistraloz approved these changes

Assignees

No one assigned

Labels

enhancementWork on new feature (or any question related to new feature)

Projects

None yet

Milestone

V4

Development

Successfully merging this pull request may close these issues.

Sending mail

3 participants

@moqmar@mistraloz@GlennM

[8]ページ先頭

©2009-2025 Movatter.jp