Help → Why does popfile.cfg sometimes get overwritten?

Why does popfile.cfg sometimes get overwritten?

I understand that /var/lib/popfile/popfile.cfg is where popfile stores all its configuration details and it looks like in a fresh installation (using sudo apt-get install popfile on ubuntu, for example) this file does not exist until you either restart popfile or customize the settings.

What I would like to understand under what circumstances this file gets overwritten and why. It has cost me countless hours trying to figure out why popfile seems to randomly break every now and then and I have traced it down to the config-file being overwritten with some default values. I would file this as a bug, but since I know about the limited capacities of the few developers, I'm limiting myself to trying to understand what causes this and maybe find a workaround.

I have a feeling that this might be related to another riddle I have, namely what the difference is between the different ways of starting and stopping popfile. In particular, I have a feeling that it is not a good idea to start popfile as root, especially not using /usr/share/popfile/start_popfile.sh.

The right way to start popfile seems to be sudo /etc/init.d/popfile start but sometimes that doesn't seem to work. (One particularly annoying thing is that it often does not report that it did not start. It just says starting popfile: popfile and only when you check the logs you see that it failed and why (for example because it was not able to bind to the html port).

Also, it seems to be possible to stop popfile using service popfile stop but service popfile start does not seem to work.

Some clarifications regarding this would be much appreciated.

  • Message #2186

    When you use apt-get to install POPFile on a Ubuntu system for the first time (i.e. when there is no trace of a previous POPFile installation) the installation process will start POPFile by supplying some key parameters (e.g. 7070 for the UI port number and 7071 for the POP3 port number) on the command-line and POPFile will use the built-in default settings for the other configuration settings.

    The POPFile Command Line and Advanced Options page in the on-line manual describes POPFile's configuration settings and mentions the default settings.

    As you have noticed, POPFile will create its configuration file (popfile.cfg) when the UI is used to customise POPFile.

    The configuration file also gets updated when POPFile performs its check for a new release.

    If you use POPFile's IMAP module then extra information is saved in the configuration file and updated as the IMAP module classifies incoming mail.

    When POPFile is shut down it always saves the current configuration settings in the configuration file (popfile.cfg).

    The right way to start popfile seems to be sudo /etc/init.d/popfile start but sometimes that doesn't seem to work.

    You should not need to start POPFile manually.

    When apt-get is used to install POPFile it adds the necessary commands to start POPFile automatically and to shut down POPFile when Ubuntu is shut down. When POPFile gets installed a user called 'popfile' is created and this username is used when the POPFile daemon is started.