Forum OpenACS Q&A: Re: OpenACS Docker Email configuration

Collapse
Posted by Tyge Cawthon on

Happy New Year and THANK YOU for all the updates. Very nicely done... I finally had time to do some testing over the weekend.

Containers in the docker compose YML file

mail-relay-1
Openacs-1
postgres-1

Case 1 - Outgoing Email only.

OpenACS GUI Configuration:
Parameters on ACS Mail Services Lite line.
Section Rollout Support
Field  EmailDeliveryMode and change from default to nssmtpd
Section Smtp
SMTPHost: smtp.celtic-arts.org
SMTPPassword: password
SMTPPort: 587
SMTPTimout: 60
SMTPUser: emailname @ address.org

OpenACS and PostgreSQL are up and running using the YML file provided by your examples.

The YML below only obtain to email-relay YML docker composer file:

      # Internal container IP and ports, to be mapped to host values
      oacs_httpport: 8080
      oacs_httpsport: 8443
      #oacs_ipaddress: "::"
      oacs_ipaddress: "0.0.0.0"
      oacs_loopbackport: ${internal_loopbackport:-8888}
      #oacs_smtprelay: plain://mail-relay:25
      
      # Enable nssmtpd on internal port 2525
      oacs_smtpdport: 2525 

  # ------------------------------------------------------------------
  #  mail-relay  (Postfix outgoing mail relay)
  # ------------------------------------------------------------------
  mail-relay:
    image: gustafn/mail-relay:latest
    hostname: smtpd.${hostname}
    restart: unless-stopped
    
    # Only internal SMTP – do not publish on host; nssmtpd talks to this
    # expose:
    #  - "25"

    environment:
      <<: *default-env
      # Use the managed certificate store (same as OpenACS uses)
      POSTFIX_TLS_CERT_FILE: /var/lib/naviserver/certificates/${hostname}.pem
      #POSTFIX_MYNETWORKS: 127.0.0.0/8 [::1]/128 172.16.0.0/12 172.27.0.0/16

Email-reply log

Notce myhostname = smtpd.BLANK

Generating /etc/postfix/main.cf from template
Generated /etc/postfix/main.cf
---
# SPDX-License-Identifier: MPL-2.0
# Identify this node
myhostname = smtpd.
myorigin   = openacs.org
# Don't accept mail *for* this host; just relay outgoing
mydestination =
inet_interfaces = all
inet_protocols = ipv4
# Internal networks allowed to relay (Docker network)
mynetworks = 127.0.0.0/8 [::1]/128 172.16.0.0/12 172.27.0.0/16
#smtpd_relay_restrictions = permit_mynetworks defer_unauth_destination
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
# We currently use MX lookups, so no relayhost by default
#relayhost = []:
# TLS (paths can be overridden if needed)
smtpd_tls_cert_file = /var/lib/naviserver/certificates/.pem
smtpd_tls_key_file  = /var/lib/naviserver/certificates/.pem
smtpd_tls_security_level = may
smtp_tls_security_level  = may
smtp_tls_loglevel        = 1
maillog_file = /var/log/mail.log
---
postfix: fatal: bad string length 0 < 1: mydomain = 
postfix: fatal: bad string length 0 < 1: mydomain = 
postfix: fatal: bad string length 0 < 1: mydomain = .....

OpenACS email GIU results test teat has been notified. Return to user administration View administrative page for newly created user, test teat

The email message appear to have been sent, but the email was never received.

/var/www/openacs/log/
smtpsend.log  empty 
/var/www/openacs/log/mail.log showed no errors

I tried several different configurations

Any suggestion?