Replies: 12 comments
-
Hi @SamMousa , SMF is a docker image, which is designed to be simple and easy to use. All the configuration of the SMF is only an environment variable: So I suggest the best practice of use SMF for update configuration is just stop the docker, set the new This kind of restart will not be an issue because the SMTP service is designed well to deal with this kind of restart, so your need no worry about any email lost. |
Beta Was this translation helpful? Give feedback.
-
I cant change the env when stopping / starting a container; I need to The problem is that the environment variable value is only specified on the On Wed, Nov 9, 2016 at 1:57 PM, Zhuohuan LI [email protected]
|
Beta Was this translation helpful? Give feedback.
-
The problem is as follows:
Now on day 100 I will have to figure out the current redirects; I can of course extract them in several ways, but none of these are easy:
Instead if I can use a config file that I can mount, all I would need to do is update the config file and restart the container. |
Beta Was this translation helpful? Give feedback.
-
I guess you just start the docker on Day 1 using the command line, then at Day 100 you forgot the SMF_CONFIG? In my case, I use https://cloud.docker.com(former Tutum.co) to run SMF. It has a well-designed docker management UI and can manage your containers very effectively. Also, it can restart your container very easy, which you can modify environment varaiables on the web. (It creates new containers each time for me). I recommend you to have a try of docker cloud, it's free for the first host. And in the other way, why do you not to try a shell script like this: #!/usr/bin/env bash
SMF_CONFIG="@a.com:[email protected]"
docker run -e SMF_CONFIG="$SMF_CONFIG" -p 25:25 zixia/simple-mail-forwarder Then at Day 100, you can just stop the old container, modify the script, add "@c.com:[email protected]" to SMF_CONFIG, and run the script again? Hope my suggestion helps. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback, I'm using that approach with rancher now. |
Beta Was this translation helpful? Give feedback.
-
Rancher is great. cheers! |
Beta Was this translation helpful? Give feedback.
-
Just to clarify; SMTP does not allow for dropping emails after they have been sent. The protocol handles servers going down before they receive the email, but if server A sends mail to C via B and B confirms the receival to A and then loses it, A will never resend it. Just an FYI. If you stop this container while there are mails in the queue, you will lose emails! |
Beta Was this translation helpful? Give feedback.
-
Yes, I agree. That's the reason why SMF has If we start SMF with this volume set, then there's not necessary to care about the container, either stop or delete it should not be an issue because before B confirm the receival, the email should already have been written to the postfix spool directory. I'm not 100% sure, please correct me if there have other race conditions. |
Beta Was this translation helpful? Give feedback.
-
If the user doesn't explicitly map a host folder to the volume, docker will generate a volume for the container. |
Beta Was this translation helpful? Give feedback.
-
Yes, it is. So you must binding VOLUME for spool directly to make sure you can delete your container without any mail lost problem. Or, exec inside the container, stop SMTP server, flush all the emails in the spool directly before you delete it. |
Beta Was this translation helpful? Give feedback.
-
Ah okay, think there was a miscommunication. As long as you properly mount the volume it is fine; if you don't you risk losing stuff! |
Beta Was this translation helpful? Give feedback.
-
Thanks, @SamMousa , I think you are right, this should write into the document. Could you please help me adding this notice to README? Because you are right in this issue, a Pull Request will be very appreciated. |
Beta Was this translation helpful? Give feedback.
-
Ideally there should be a way to update the configuration of the forwarder after creation.
For example an forward configuration file could be mounted and watched for changes as an alternative to the environment variable.
Beta Was this translation helpful? Give feedback.
All reactions