Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
736 views
in Technique[技术] by (71.8m points)

centos7 - Implemet Postfix into Mailman 3

I try to implement Postfix with a docker-compose.yml into Mailman 3. There is no MTA on the local Server installed. The reason is there are running only Docker container on it.

Here are the error messages:

                               List of databases
   Name    |  Owner  | Encoding |  Collate   |   Ctype    |  Access privileges  
-----------+---------+----------+------------+------------+---------------------
 mailmandb | mailman | UTF8     | en_US.utf8 | en_US.utf8 | 
 postgres  | mailman | UTF8     | en_US.utf8 | en_US.utf8 | 
 template0 | mailman | UTF8     | en_US.utf8 | en_US.utf8 | =c/mailman         +
           |         |          |            |            | mailman=CTc/mailman
 template1 | mailman | UTF8     | en_US.utf8 | en_US.utf8 | =c/mailman         +
           |         |          |            |            | mailman=CTc/mailman
(4 rows)

No MTA environment variable found, defaulting to Exim
HYPERKITTY_URL not set, using the default value of http://mailman-web:8000/hyperkitty

the docker-compose.yml

version: '2'

services:
  postfix:
    image: instrumentisto/postfix:3
    restart: unless-stopped
    volumes:
    - /opt/mailman/postfix:/etc/postfix/main.cf.d
    - /opt/mailman/mailman-core:/opt/mailman
    ports:
    - "25:25"
    networks:
      mailman:
        ipv4_address: 172.19.199.1

services:
  mailman-core:
    image: maxking/mailman-core:0.3
    restart: unless-stopped
    stop_grace_period: 30s
    container_name: mailman-core
    hostname: mailman-core
    volumes:
    - /opt/mailman-core:/opt/mailman/
    links:
    - database:database
    depends_on:
    - database
    environment:
    - DATABASE_URL=postgres://mailman:mailmanpass@database/mailmandb
    - DATABASE_TYPE=postgres
    - DATABASE_CLASS=mailman.database.postgresql.PostgreSQLDatabase
    - SMTP_HOST=172.19.199.1
    - HYPERKITTY_API_KEY=ZawB3NGBUgbmQcMGhZ0kYIW0WRNw8P9osEudsGiFZWv
    networks:
      mailman:
        ipv4_address: 172.19.199.2

  mailman-web:
    image: maxking/mailman-web:0.3
    container_name: mailman-web
    restart: unless-stopped
    hostname: mailman-web
    ports:
    - "8000:8000"
    depends_on:
    - database
    links:
    - mailman-core:mailman-core
    - database:database
    volumes:
    - /opt/mailman/mailman-web:/opt/mailman-web-data
    environment:
    - DATABASE_TYPE=postgres
    - DATABASE_URL=postgres://mailman:mailmanpass@database/mailmandb
    - HYPERKITTY_API_KEY=ZawB3NGBUgbmQcMGhZ0kYIW0WRNw8P9osEudsGiFZWv
    - UWSGI_STATIC_MAP=/static=/opt/mailman-web-data/static
    - SERVE_FROM_DOMAIN=lists.example.com
    - MAILMAN_ADMIN_USER=admin
    - [email protected]
    - SECRET_KEY=mailmangeheim
    networks:
      mailman:
        ipv4_address: 172.19.199.3

  database:
    image: postgres:9.6-alpine
    restart: unless-stopped
    environment:
      POSTGRES_DB: mailmandb
      POSTGRES_USER: mailman
      POSTGRES_PASSWORD: mailmanpass
    volumes:
    - /opt/mailman/database:/var/lib/postgresql/data
    networks:
      mailman:
        ipv4_address: 172.19.199.4

networks:
   mailman:
     driver: bridge
     ipam:
       driver: default
       config:
         - subnet: 172.19.199.0/24

the mailman/core/mailman-extra.cfg

[mta]
incoming: mailman.mta.postfix.LMTP
outgoing: mailman.mta.deliver.deliver
lmtp_host: 172.19.199.2
lmtp_port: 8024
smtp_host: 172.19.199.1
smtp_port: 25
configuration: /etc/postfix-mailman.cfg

the mailman/web/settings.local.py

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = '172.19.199.1'
EMAIL_PORT = 25
USE_SSL = False
DEFAULT_FROM_EMAIL = "[email protected]"
SERVER_EMAIL = "[email protected]"

the mailman/postfix/base.cf

myhostname = lists.example.com
mynetworks = 127.0.0.1/32 172.19.199.0/24

the mailman/postfix/main.cf

# Support the default VERP delimiter.
recipient_delimiter = +
unknown_local_recipient_reject_code = 550
owner_request_special = no

transport_maps = regexp:/opt/mailman/var/data/postfix_lmtp
local_recipient_maps = regexp:/opt/mailman/var/data/postfix_lmtp
relay_domains = regexp:/opt/mailman/var/data/postfix_domains
question from:https://stackoverflow.com/questions/65951555/implemet-postfix-into-mailman-3

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...