Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for setting any Postfix variables in the config file #74

Closed
knipknap opened this issue Jul 4, 2020 · 3 comments
Closed

Allow for setting any Postfix variables in the config file #74

knipknap opened this issue Jul 4, 2020 · 3 comments

Comments

@knipknap
Copy link

knipknap commented Jul 4, 2020

Stolen from wader/postfix-relay, I propose to add the following line to your entrypoint.sh:

for e in ${!POSTFIX_*} ; do postconf -e "${e:8}=${!e}" ; done

This allows for setting up postfix in a Docker swarm / compose, without having to mount a whole configfile. Usage:

  mail_relay:
    image: zixia/simple-mail-forwarder:1.1
    networks:
      - traefik-public
      - default
    deploy:
      labels:
        - traefik.enable=true
        - traefik.docker.network=traefik-public
        - traefik.constraint-label=traefik-public
        - traefik.tcp.routers.mail_relay.rule=HostSNI(`*`)
        - traefik.tcp.routers.mail_relay.entrypoints=smtp
        - traefik.tcp.routers.mail_relay.service=mail_relay
        - traefik.tcp.services.mail_relay.loadbalancer.server.port=25
    environment:
      - SMF_DOMAIN=domain1.com
      - |
        SMF_CONFIG=
        [email protected]:[email protected];
        [email protected]:[email protected];
      - POSTFIX_myhostname=smtp.domain1.com
      - POSTFIX_relay_domains="domain1.com domain2.com"
      - POSTFIX_smtpd_recipient_restrictions=permit_mynetworks, permit_sasl_authenticated

(note the last three lines)

@huan
Copy link
Owner

huan commented Jul 5, 2020

Please feel free to create a PR to implement it, and do not forget to add the related docs in README and unit tests as well.

@tamaro-skaljic
Copy link
Contributor

tamaro-skaljic commented Apr 2, 2021

@huan This issue can be closed, #92 implemented this feature.

@huan
Copy link
Owner

huan commented Apr 3, 2021

@tamaro-skaljic @knipknap @dgraziotin thank your very much for the efforts to enhance SMF!

@huan huan closed this as completed Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants