Skip to content

Commit 3a5ba24

Browse files
Yevhen Miroshnychenkoshiftedreality
andauthored
MAGECLOUD-4922: Email still trying to be sent when ENABLE_SENDMAIL=false is used (#145)
Co-authored-by: Oleg Posyniak <[email protected]>
1 parent f2732fe commit 3a5ba24

File tree

16 files changed

+51
-25
lines changed

16 files changed

+51
-25
lines changed

images/php/7.1-cli/docker-entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ touch $CRON_LOG
4141
echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf
4242
service rsyslog start
4343

44+
PHP_EXT_DIR=/usr/local/etc/php/conf.d
45+
4446
# Configure Sendmail if required
4547
if [ "$ENABLE_SENDMAIL" == "true" ]; then
48+
sed -i "s/!SENDMAIL_PATH!/\/usr\/sbin\/sendmail -t -i/" ${PHP_EXT_DIR}/zz-mail.ini
4649
/etc/init.d/sendmail start
50+
else
51+
sed -i "s/!SENDMAIL_PATH!/\"true > \/dev\/null\"/" ${PHP_EXT_DIR}/zz-mail.ini
4752
fi
4853

49-
PHP_EXT_DIR=/usr/local/etc/php/conf.d
50-
5154
# Substitute in php.ini values
5255
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" ${PHP_EXT_DIR}/zz-magento.ini
5356
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" ${PHP_EXT_DIR}/zz-magento.ini
@@ -64,6 +67,7 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
6467
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
6568
fi
6669

70+
6771
# Configure composer
6872
[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \
6973
composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN

images/php/7.1-cli/etc/mail.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
; Sendmail
2-
sendmail_path=/usr/sbin/sendmail -t -i
2+
sendmail_path=!SENDMAIL_PATH!

images/php/7.1-fpm/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ fi
3030
# Ensure our Magento directory exists
3131
mkdir -p $MAGENTO_ROOT
3232

33+
PHP_EXT_DIR=/usr/local/etc/php/conf.d
34+
3335
# Configure Sendmail if required
3436
if [ "$ENABLE_SENDMAIL" == "true" ]; then
37+
sed -i "s/!SENDMAIL_PATH!/\/usr\/sbin\/sendmail -t -i/" ${PHP_EXT_DIR}/zz-mail.ini
3538
/etc/init.d/sendmail start
39+
else
40+
sed -i "s/!SENDMAIL_PATH!/\"true > \/dev\/null\"/" ${PHP_EXT_DIR}/zz-mail.ini
3641
fi
3742

38-
PHP_EXT_DIR=/usr/local/etc/php/conf.d
39-
4043
# Substitute in php.ini values
4144
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" ${PHP_EXT_DIR}/zz-magento.ini
4245
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" ${PHP_EXT_DIR}/zz-magento.ini

images/php/7.1-fpm/etc/mail.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
; Sendmail
2-
sendmail_path=/usr/sbin/sendmail -t -i
2+
sendmail_path=!SENDMAIL_PATH!

images/php/7.2-cli/docker-entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ touch $CRON_LOG
4141
echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf
4242
service rsyslog start
4343

44+
PHP_EXT_DIR=/usr/local/etc/php/conf.d
45+
4446
# Configure Sendmail if required
4547
if [ "$ENABLE_SENDMAIL" == "true" ]; then
48+
sed -i "s/!SENDMAIL_PATH!/\/usr\/sbin\/sendmail -t -i/" ${PHP_EXT_DIR}/zz-mail.ini
4649
/etc/init.d/sendmail start
50+
else
51+
sed -i "s/!SENDMAIL_PATH!/\"true > \/dev\/null\"/" ${PHP_EXT_DIR}/zz-mail.ini
4752
fi
4853

49-
PHP_EXT_DIR=/usr/local/etc/php/conf.d
50-
5154
# Substitute in php.ini values
5255
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" ${PHP_EXT_DIR}/zz-magento.ini
5356
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" ${PHP_EXT_DIR}/zz-magento.ini
@@ -64,6 +67,7 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
6467
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
6568
fi
6669

70+
6771
# Configure composer
6872
[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \
6973
composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN

images/php/7.2-cli/etc/mail.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
; Sendmail
2-
sendmail_path=/usr/sbin/sendmail -t -i
2+
sendmail_path=!SENDMAIL_PATH!

images/php/7.2-fpm/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ fi
3030
# Ensure our Magento directory exists
3131
mkdir -p $MAGENTO_ROOT
3232

33+
PHP_EXT_DIR=/usr/local/etc/php/conf.d
34+
3335
# Configure Sendmail if required
3436
if [ "$ENABLE_SENDMAIL" == "true" ]; then
37+
sed -i "s/!SENDMAIL_PATH!/\/usr\/sbin\/sendmail -t -i/" ${PHP_EXT_DIR}/zz-mail.ini
3538
/etc/init.d/sendmail start
39+
else
40+
sed -i "s/!SENDMAIL_PATH!/\"true > \/dev\/null\"/" ${PHP_EXT_DIR}/zz-mail.ini
3641
fi
3742

38-
PHP_EXT_DIR=/usr/local/etc/php/conf.d
39-
4043
# Substitute in php.ini values
4144
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" ${PHP_EXT_DIR}/zz-magento.ini
4245
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" ${PHP_EXT_DIR}/zz-magento.ini

images/php/7.2-fpm/etc/mail.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
; Sendmail
2-
sendmail_path=/usr/sbin/sendmail -t -i
2+
sendmail_path=!SENDMAIL_PATH!

images/php/7.3-cli/docker-entrypoint.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,23 @@ touch $CRON_LOG
4141
echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf
4242
service rsyslog start
4343

44+
PHP_EXT_DIR=/usr/local/etc/php/conf.d
45+
4446
# Configure Sendmail if required
4547
if [ "$ENABLE_SENDMAIL" == "true" ]; then
48+
sed -i "s/!SENDMAIL_PATH!/\/usr\/sbin\/sendmail -t -i/" ${PHP_EXT_DIR}/zz-mail.ini
4649
/etc/init.d/sendmail start
50+
else
51+
sed -i "s/!SENDMAIL_PATH!/\"true > \/dev\/null\"/" ${PHP_EXT_DIR}/zz-mail.ini
4752
fi
4853

49-
PHP_EXT_DIR=/usr/local/etc/php/conf.d
50-
5154
# Substitute in php.ini values
5255
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" ${PHP_EXT_DIR}/zz-magento.ini
5356
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" ${PHP_EXT_DIR}/zz-magento.ini
5457

5558
# Add custom php.ini if it exists
5659
[ -f "/app/php.ini" ] && cp /app/php.ini ${PHP_EXT_DIR}/zzz-custom-php.ini
5760

58-
5961
# Enable PHP extensions
6062
PHP_EXT_COM_ON=docker-php-ext-enable
6163

@@ -65,6 +67,7 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
6567
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
6668
fi
6769

70+
6871
# Configure composer
6972
[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \
7073
composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN

images/php/7.3-cli/etc/mail.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
; Sendmail
2-
sendmail_path=/usr/sbin/sendmail -t -i
2+
sendmail_path=!SENDMAIL_PATH!

0 commit comments

Comments
 (0)