Hi Denny,
On 06/22/2011 07:19 AM, Denny Schierz wrote:
I want to use two backends für DoveCot. One generated file from the LDAP tree, and the real LDAP.
The first backend is generated from a cronjob thats reads the whole ldap server and converts them into a DoveCot passwd file.
OK.
I red in the Wiki, if the user password isn't correct, than DoveCot asks the second backend (LDAP). Is this correct? Because, the the user can change his password, but Cron generates only every hour the file. So the password in the passwd-file isn't correct, until Cron runs again.
I don't know this.
The second, what happens, if Dovecot reads the file and in the same moment, Cron generate the new file? Does he change to the second backend? Or do I (the user) get an error?
I do know this. If the cron job is writing directly to the passwd file, you will have opportunities where dovecot can see a partial file. I don't know what will happen for sure in this case, but you might trigger rare bugs.
You should make your cron job write to a temporary new file, close it, then rename it to the correct name. This will atomically replace the old version with the update. If dovecot has the file open when you do this, it will carry on with the prior copy (delete will be deferred until the file is closed). Dovecot will see the changes the next time it opens the file.
cu denny
HTH,
Phil