huan / docker-simple-mail-forwarder

Simplest and Smallest Email Forward Service based on Docker.
https://hub.docker.com/r/zixia/simple-mail-forwarder/
Apache License 2.0
544 stars 88 forks source link

config file instead of config environment variable #118

Open jaydouble opened 1 year ago

jaydouble commented 1 year ago

Hi,

I want to use this, but I need a couple of forwards. When I create a couple of forwards the config environment variable will become a long string, so it will become a potential failure.

Is it possible to create a config file, that will be the same a the config, but then newline separated? So the script to load to config will be like:

if [ -z "$SMF_CONFIG" ]; then
  SMF_CONFIG=$(cat /smf_config.txt | tr '\n' ';')
fi

that script is not tested, just a thinking around..

huan commented 1 year ago

Thanks for sharing!

It looks like it's a convenient way to load the config to the environment variable; if it works as expected, I'd like to accept a PR to add it to README as a recommended way to load the config from the file.

jaydouble commented 1 year ago

Hi, a added a PR:

119