Skip to content

Commit

Permalink
Add Postfix in Canasta (#475)
Browse files Browse the repository at this point in the history
* Add Postfix in Canasta

* Add Postfix in Canasta

* Add Postfix in Canasta
  • Loading branch information
naresh-kumar-babu authored Jan 9, 2025
1 parent eeae236 commit aad877c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ RUN set -x; \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer self-update 2.1.3

RUN set -x; \

Check failure on line 98 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

DL3015 info: Avoid additional packages by specifying `--no-install-recommends`

Check failure on line 98 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

Check failure on line 98 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

DL3027 warning: Do not use apt as it is meant to be a end-user tool, use apt-get or apt-cache instead

Check failure on line 98 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 98 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

DL3009 info: Delete the apt-get lists after installing something
# Preconfigure Postfix to avoid the interactive prompt
echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections \
&& echo "postfix postfix/mailname string $MAILNAME" | debconf-set-selections \
&& apt-get update \
&& apt-get install -y mailutils \
&& apt install -y postfix

COPY main.cf /etc/postfix/main.cf

FROM base AS source

# MediaWiki core
Expand Down
7 changes: 7 additions & 0 deletions _sources/scripts/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ make_dir_writable "$MW_VOLUME" -not '(' -path "$MW_VOLUME/images" -prune ')'
# Running php-fpm
/run-php-fpm.sh &

echo "root: $EMAIL" >> /etc/aliases
echo "$MAILNAME" >> /etc/mailname
echo "[$SMTP_DOMAIN]:$SMTP_PORT $EMAIL:$EMAIL_PASSWORD" >> /etc/postfix/sasl_passwd
chmod 0600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
service postfix start

############### Run Apache ###############
# Make sure we're not confused by old, incompletely-shutdown httpd
# context after restarting the container. httpd won't start correctly
Expand Down
39 changes: 39 additions & 0 deletions main.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html - default to 3.6 on
# fresh installs.
compatibility_level = 3.6
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, /etc/mailname, localhost, localhost.localdomain, localhost
relayhost = [smtp.gmail.com]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

0 comments on commit aad877c

Please sign in to comment.