Skip to content

Enable user definable fetchmail poll times#731

Merged
johansmitsnl merged 3 commits intodocker-mailserver:masterfrom
dmcgrandle:fix-fetchmail-poll
Oct 4, 2017
Merged

Enable user definable fetchmail poll times#731
johansmitsnl merged 3 commits intodocker-mailserver:masterfrom
dmcgrandle:fix-fetchmail-poll

Conversation

@dmcgrandle
Copy link
Copy Markdown
Contributor

@dmcgrandle dmcgrandle commented Oct 2, 2017

* create new ENV variable FETCHMAIL_POLL in target/start-mailserver.sh
* change --daemon setting in supervisor-app.conf to use ENV var

stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
user=fetchmail
command=/usr/bin/fetchmail -f /etc/fetchmailrc -v --nodetach --daemon 300 -i /var/lib/fetchmail/.fetchmail-UIDL-cache --pidfile /var/run/fetchmail/fetchmail.pid
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it do when you remove all your changes, just change the deamon time to 60 (or so) and use the nopoll configuration?
If it polls every 60 seconds the fix is more simple then I thought. I don't have a setup like this so could you verify this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can test this later tomorrow, but I’m quite sure it will poll at whatever value it is set to. However, the point of this change wasn’t to change the default from 300 seconds to 60 - that is easy. The point of this change is to allow the user to set it to whatever value they want in their config/fetchmail.cf file. To make it user-definable. The change you are suggesting simply makes a new default of 60 without allowing the user to change it, unless I am misunderstanding something?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If his works it can be easily changed with just a single env variable and there is no need for a bigger change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think I see what you are getting at now. Rather than mess with the existing files or code, we could simply set an environmental variable such as FETCHMAIL_POLL to the desired poll rate and in the supervisor conf file we could then use "--daemon %(ENV_FETCHMAIL_POLL)" instead of "--daemon 300", and set the default to 300 in case the user doesn't define it. Interesting. I will try this out and let you know - yes, it would be a much simpler change. :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got it ;)

* create new ENV variable FETCHMAIL_POLL in target/start-mailserver.sh
* change --daemon setting in supervisor-app.conf to use ENV var
@dmcgrandle dmcgrandle changed the title Enable variable polling rates for fetchmail Enable user definable fetchmail poll times Oct 3, 2017
* Put FETCHMAIL_POLL env variable in Dockerfile to handle case where
  user does not specify it in their docker-compose.yml
@dmcgrandle
Copy link
Copy Markdown
Contributor Author

Johan - this is passing all tests and completing successfully on my local machine. Any idea why this failed the Travis CI build?

@dmcgrandle
Copy link
Copy Markdown
Contributor Author

I pushed an empty commit to trigger another Travis CI build and this time it passed. Strange.

@johansmitsnl johansmitsnl merged commit 5961b31 into docker-mailserver:master Oct 4, 2017
@dmcgrandle dmcgrandle deleted the fix-fetchmail-poll branch October 4, 2017 20:31
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.

2 participants