On Tue, 25 Jan 2005, Magnus Holmgren wrote:
Dovecot can be run from inetd. In that case, /etc/init.d/dovecot shouldn't try to start anything. That script looks for the protocols setting in dovecot.conf. However, the default value is "imap imaps",
Actually, the default value is empty. Which is why we need the test. Read on:
In 0.99.13 I can see the following in src/master/master-settings.c:
struct settings default_settings = { [...] MEMBER(protocols) "imap imaps", [...] }
and that was what I experienced when I tested, too.
(make that "could")
meaning that if it is absent, dovecot should still be started.
Yes, but the script doesn't deal with that anyway. It just checks for a protocols setting which mentions at least one of the four protocols, then checks that at least one of the two login handlers are present. It doesn't check for a valid combination. (If we're talking about the same version.)
The problem is the debian package is split up. [...]
Moreover, the protocols setting is still needed when dovecot is run from inetd. Therefore I suggest that the current test
if grep protocols /etc/dovecot/dovecot.conf | sed 's/#.*$//' | tr -d '"' \ | egrep -q '[^#]*(\bpop3s?\b|\bimaps?\b)'; then
be replaced with a test similar to the one the exim init.d script, like so:
if [ -f /etc/inetd.conf ] && grep -E -q "^ *([0-9.]+:)?(pop3s?|imaps?)" \ /etc/inetd.conf then exit 0 else
so it looks like the second test should be in addition to the first, not replacing it. I'll include it in the next version.
So to make it complete, there should first be my test, then something like
PROTOCOLS=`grep protocols /etc/dovecot/dovecot.conf | sed 's/#.*$//' | `tr -d '"'
if ( ( echo $PROTOCOLS | egrep -q '[^#]*(\bpop3s?\b)' ) && [ -x /usr/lib/dovecot/pop3-login -a -x /usr/lib/dovecot/pop3 ] ) || ( ( echo $PROTOCOLS | egrep -q '[^#]*(\bimaps?\b)' ) && [ -x /usr/lib/dovecot/imap-login -a -x /usr/lib/dovecot/imap ] ) then
Btw, did Timo ever respond to you about your other patch?
No. Maybe I should send a reminder to him directly.
-- Magnus
-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]