Skip to content

Commit 4e7fdf9

Browse files
committed
Fix manpage in documentation & add tests for DMA
1 parent d9e7020 commit 4e7fdf9

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,11 @@ DMA_CONF_SMARTHOST=smtp.example.org
463463
DMA_AUTH_USERNAME=noreply
464464
DMA_AUTH_PASSWORD=helloworld123
465465
# further DMA settings, according to the DMA man page, prefixed with DMA_CONF_
466-
# (see https://manpages.debian.org/unstable/dma/sendmail.8.en.html#dma.conf)
467-
DMA_CONF_STARTTLS=1
466+
# (see https://dspinellis.github.io/manview/?src=https://raw.githubusercontent.com/corecode/dma/v0.12/dma.8)
467+
# important for boolean settings: a specified but empty variable corresponds
468+
# to true, an unspecified one to false!
469+
DMA_CONF_SECURETRANSFER=
470+
DMA_CONF_STARTTLS=
468471
```
469472

470473
DMA is **installed by default in the fat images**. If you are using the "*slim*" images, you need to install it by passing

build-and-test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,24 @@ docker build -t test/composer_with_gd --build-arg PHP_VERSION="${PHP_VERSION}" -
213213
docker run --rm test/composer_with_gd sudo composer update
214214
docker rmi test/composer_with_gd
215215

216+
# Let's check that we can send mail directly
217+
TESTMAIL_ID_DIRECT=$RANDOM
218+
docker run --rm -e DMA_BLOCKING=1 "thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}" php -r "mail('[email protected]', 'Hello World ${TESTMAIL_ID_DIRECT}', 'This is an automatic test email, using a direct connection.');"
219+
220+
# Let's check that we can send mail through a smarthost with credentials
221+
# 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.
222+
TESTMAIL_ID_SMARTHOST=$RANDOM
223+
docker 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 [email protected] -e DMA_AUTH_PASSWORD=pjxG3kc3VR31jQUvHz "thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}" php -r "mail('[email protected]', 'Hello World ${TESTMAIL_ID_SMARTHOST}', 'This is an automatic test email, using a smarthost.');"
224+
225+
# Let's check that the mails came through
226+
ETHEREAL_COOKIEJAR=$(mktemp --tmpdir ethereal-cookies.XXXXXXXXXX)
227+
ETHEREAL_CSRF=$(curl https://ethereal.email/login -s --fail -c "${ETHEREAL_COOKIEJAR}" | grep -Pom1 '\bname="_csrf" value="\K[^"]+')
228+
curl https://ethereal.email/login -s --fail -X POST --data-urlencode "[email protected]" --data-urlencode "password=pjxG3kc3VR31jQUvHz" --data-urlencode "_csrf=${ETHEREAL_CSRF}" -b "${ETHEREAL_COOKIEJAR}" -c "${ETHEREAL_COOKIEJAR}" >/dev/null
229+
ETHEREAL_INBOX=$(curl https://ethereal.email/messages -s --fail -b "${ETHEREAL_COOKIEJAR}")
230+
rm "${ETHEREAL_COOKIEJAR}"
231+
echo "${ETHEREAL_INBOX}" | grep -F ">Hello World ${TESTMAIL_ID_DIRECT}<"
232+
echo "${ETHEREAL_INBOX}" | grep -F ">Hello World ${TESTMAIL_ID_SMARTHOST}<"
233+
216234
#################################
217235
# Let's build the "node" images
218236
#################################

utils/README.blueprint.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,11 @@ DMA_CONF_SMARTHOST=smtp.example.org
381381
DMA_AUTH_USERNAME=noreply
382382
DMA_AUTH_PASSWORD=helloworld123
383383
# further DMA settings, according to the DMA man page, prefixed with DMA_CONF_
384-
# (see https://manpages.debian.org/unstable/dma/sendmail.8.en.html#dma.conf)
385-
DMA_CONF_STARTTLS=1
384+
# (see https://dspinellis.github.io/manview/?src=https://raw.githubusercontent.com/corecode/dma/v0.12/dma.8)
385+
# important for boolean settings: a specified but empty variable corresponds
386+
# to true, an unspecified one to false!
387+
DMA_CONF_SECURETRANSFER=
388+
DMA_CONF_STARTTLS=
386389
```
387390

388391
DMA is **installed by default in the fat images**. If you are using the "*slim*" images, you need to install it by passing

0 commit comments

Comments
 (0)