Skip to content

Conversation

@jaydouble
Copy link

added SMF_CONFIG_FILE variable to use a file for config.
to add file, be creative, you can use a bind mount, but also a secret.
A bit easier to read if you have more than one forward to make. Maybe also a bit less change for misstakes.

@CLAassistant
Copy link

CLAassistant commented Feb 8, 2023

CLA assistant check
All committers have signed the CLA.

@huan
Copy link
Owner

huan commented Feb 9, 2023

Dear @jaydouble , thank you very much for the contribution; the code looks good!

However, I think it would be better not to introduce another parameter for SMF, which might make it more complicated.

Could you please provide a helper script for loading the data from the file and outputting the string which can satisfy the SMF_CONFIG format?

It would be perfect like this:

$ export SMF_CONFIG=`./scripts/smf-config-file.sh smf.config`
# ...

@jaydouble
Copy link
Author

Maybe better to let the user chose:
If he doesn't want to have a file variable, he can use:

export SMF_CONFIG=$(cat smf.config)
docker run -e SMF_CONFIG ....

If he want to use a config file variable, like when using a docker swarm he can use:

version: "3.8"

volumes:
  config:

services:
  smf:
    image: zixia/simple-mail-forwarder
    volumes:
      - config:/config
    ports:
      - 25:25
    environment:
      SMF_CONFIG_FILE: "/config/forwards"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants