[Dovecot] Upgrade Too 1.2.11 Broke Everything
Good Day.
I have had dovecot working successfully for years now, however after a system update , dovecot refused to start up complaing that im not using absolute paths. It took a bit of hacking to get it working again as can be seen by the sql query, however now imap doesn't work anymore because of that change. Im lost!!
dovecot --version 1.2.11
dovecot -n # 1.2.11: /usr/local/etc/dovecot.conf # OS: FreeBSD 8.1-PRERELEASE amd64 protocols: imap pop3 listen(default): * listen(imap): * listen(pop3): *:110 ssl: no disable_plaintext_auth: no login_dir: /var/run/dovecot/login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(pop3): /usr/local/libexec/dovecot/pop3-login login_greeting: thavinci Ready verbose_proctitle: yes first_valid_uid: 125 first_valid_gid: 125 mail_access_groups: postfix mail_privileged_group: postfix mail_location: mbox:~:INBOX=/var/mail/%u mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(pop3): /usr/local/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3 imap_client_workarounds(default): delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep imap_client_workarounds(imap): delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep imap_client_workarounds(pop3): pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh lda: postmaster_address: postmaster@example.com sendmail_path: /usr/sbin/sendmail auth default: passdb: driver: sql args: /usr/local/etc/dovecot-mysql.conf passdb: driver: sql args: /usr/local/etc/dovecot-mysql.conf userdb: driver: sql args: /usr/local/etc/dovecot-mysql.conf userdb: driver: sql args: /usr/local/etc/dovecot-mysql.conf
In regards to this file the following was changed to make it work...
mail_location = mbox:~:INBOX=/var/mail/%u
Used to be:
mail_location = mbox:~/mail/:INBOX=/var/mail/%u
grep -v '^ *\(#.*\)\?$' dovecot-mysql.conf driver = mysql default_pass_scheme = CRYPT connect = host=xx.xx.xx.xx dbname=nameofdb user=dbuser password=dbpassword password_query = SELECT password FROM mailbox WHERE username = '%u' AND active = '1' user_query = SELECT maildir, concat('/var/mail/',maildir) AS home, 125 AS uid, 125 AS gid FROM mailbox WHERE username = '%u' AND active = '1'
This query used to be:
user_query = SELECT maildir, maildir AS home, 125 AS uid, 125 AS gid FROM mailbox WHERE username = '%u' AND active = '1'
A snapshot of the maillog during failure
Jun 29 11:50:15 thavinci postfix/qmgr[1469]: BA3DD9B4C9: removed Jun 29 11:50:49 thavinci dovecot: imap-login: Login: user=me@thavinci.za.net, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Jun 29 11:50:49 thavinci dovecot: IMAP(me@thavinci.za.net): Connection closed bytes=53/372 Jun 29 11:52:05 thavinci dovecot: imap-login: Login: user=me@thavinci.za.net, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Jun 29 11:52:05 thavinci dovecot: IMAP(me@thavinci.za.net): Connection closed bytes=53/372 Jun 29 11:52:05 thavinci dovecot: imap-login: Login: user=me@thavinci.za.net, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Jun 29 11:52:05 thavinci dovecot: IMAP(me@thavinci.za.net): stat(/var/mail/me@thavinci.za.net/.imap/INBOX) failed: Not a directory Jun 29 11:52:05 thavinci last message repeated 2 times Jun 29 11:52:05 thavinci dovecot: IMAP(me@thavinci.za.net): open() failed with subscription file /var/mail/me@thavinci.za.net/.subscriptions: Not a directory Jun 29 11:52:05 thavinci dovecot: IMAP(me@thavinci.za.net): Connection closed bytes=306/4046
As can be seen somehow it's trying to write to the mbox file and I have no idea why!
And this is the db structure!
SET FOREIGN_KEY_CHECKS=0;
-- Table structure for mailbox_copy
DROP TABLE IF EXISTS mailbox_copy
;
CREATE TABLE mailbox_copy
(
username
varchar(255) NOT NULL DEFAULT '',
password
varchar(255) NOT NULL DEFAULT '',
name
varchar(255) NOT NULL DEFAULT '',
maildir
varchar(255) NOT NULL DEFAULT '',
quota
int(10) NOT NULL DEFAULT '0',
domain
varchar(255) NOT NULL DEFAULT '',
created
datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
modified
datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
active
tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (username
),
KEY username
(username
)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Virtual
Mailboxes';
-- Records of mailbox_copy
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 1 Jul 2010, Marcel Grandemange wrote:
I have had dovecot working successfully for years now, however after a system update , dovecot refused to start up complaing that im not using absolute paths.
In regards to this file the following was changed to make it work...
mail_location = mbox:~:INBOX=/var/mail/%u
Used to be:
mail_location = mbox:~/mail/:INBOX=/var/mail/%u
Here you don't change any relative path, but change to base dir of your mailboxes, that should be wrong for any user using the default path.
user_query = SELECT maildir, concat('/var/mail/',maildir) AS home, 125 AS uid, 125 AS gid FROM mailbox WHERE username = '%u' AND active = '1'
This query used to be:
user_query = SELECT maildir, maildir AS home, 125 AS uid, 125 AS gid FROM mailbox WHERE username = '%u' AND active = '1'
I guess, the problem is in maildir, this is not absolute.
Jun 29 11:52:05 thavinci dovecot: IMAP(me@thavinci.za.net): stat(/var/mail/me@thavinci.za.net/.imap/INBOX) failed: Not a directory
Your mysql query returns /var/mail/<<maildir>> as home directory, where Dovecot puts files.
Please
a) post the content of one SQL record and
b) make sure every user has an unique, writeable home directory. http://wiki.dovecot.org/VirtualUsers/Home (Note this applies to all user, but system users usually have an unique homedir)
Regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBTCyghL+Vh58GPL/cAQJWfggAoK15kZRU8rnYh8EvjNQ0/L3i9QZ5Ape5 J/fwSBqfcT1V4rt2lvmYvhLVWvf/tQAM61s1IgAVpfOz5O78b2BecvkAhA3NfNjm vT25B+RwFFzGVCUhWPrWSk84DsH5wLlnrkb10jtMXtwpvVwEAR4ecPhEjb6I7bhO uk67a6KWyqkxHc9f8WzpoHZTiX1zCRZDeiDJkFE96fqD6ZrLdb0Fo6bHNu2rq5kx 0y3ak5Lz8X4LgEeW2EGiCJ4BzwWA4VzVDadw7MXF1cIIVCO+0g7SgNm8FQdEW3CJ WVay/dNCyBSJ/EYiJmUM7hkYpSpMJ8lU5kI7waUq/in3Ga/mjysY4w== =tRvl -----END PGP SIGNATURE-----
I have had dovecot working successfully for years now, however after a system update , dovecot refused to start up complaing that im not using absolute paths.
In regards to this file the following was changed to make it work...
mail_location = mbox:~:INBOX=/var/mail/%u
Used to be:
mail_location = mbox:~/mail/:INBOX=/var/mail/%u
Here you don't change any relative path, but change to base dir of your mailboxes, that should be wrong for any user using the default path.
Not sure what you mean here.
user_query = SELECT maildir, concat('/var/mail/',maildir) AS home, 125 AS uid, 125 AS gid FROM mailbox WHERE username = '%u' AND active = '1'
This query used to be:
user_query = SELECT maildir, maildir AS home, 125 AS uid, 125 AS gid FROM mailbox WHERE username = '%u' AND active = '1'
I guess, the problem is in maildir, this is not absolute.
Jun 29 11:52:05 thavinci dovecot: IMAP(me@thavinci.za.net): stat(/var/mail/me@thavinci.za.net/.imap/INBOX) failed: Not a directory
Your mysql query returns /var/mail/<<maildir>> as home directory, where Dovecot puts files.
Please
a) post the content of one SQL record and
pdktar@thavinci.za.net $1$06ae4b60$W/.iorSE/8ODJmh8Om4cf1 Tarun Peedikayil pdktar@thavinci.za.net 0 thavinci.za.net 2008-05-21 20:52:04 2008-05-21 20:52:04 1
I will be deleting this account so don't worry about the fact I disclosed details ;>
b) make sure every user has an unique, writeable home directory. http://wiki.dovecot.org/VirtualUsers/Home (Note this applies to all user, but system users usually have an unique homedir)
This is where the fault lies, ive fiddled till I got it working but I never had to specify a writable unique home directory in the past, it just worked. I create users via postfixadmin and tried to specify /var/mail/%u/ as the unique directory but of course it complains that dir doesn't exist then. I would have expected it to create it, itself. That would solve that issue.
I have done all sorts of work arounds now to continue operating without it by using /var/empty and all that , but now my squirrelmail doesn't work like it should anymore.
Advise?
Regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBTCyghL+Vh58GPL/cAQJWfggAoK15kZRU8rnYh8EvjNQ0/L3i9QZ5Ape5 J/fwSBqfcT1V4rt2lvmYvhLVWvf/tQAM61s1IgAVpfOz5O78b2BecvkAhA3NfNjm vT25B+RwFFzGVCUhWPrWSk84DsH5wLlnrkb10jtMXtwpvVwEAR4ecPhEjb6I7bhO uk67a6KWyqkxHc9f8WzpoHZTiX1zCRZDeiDJkFE96fqD6ZrLdb0Fo6bHNu2rq5kx 0y3ak5Lz8X4LgEeW2EGiCJ4BzwWA4VzVDadw7MXF1cIIVCO+0g7SgNm8FQdEW3CJ WVay/dNCyBSJ/EYiJmUM7hkYpSpMJ8lU5kI7waUq/in3Ga/mjysY4w== =tRvl -----END PGP SIGNATURE-----
On Thu, 1 Jul 2010 18:57:11 +0200 Marcel Grandemange thavinci@thavinci.za.net articulated:
This is where the fault lies, ive fiddled till I got it working but I never had to specify a writable unique home directory in the past, it just worked. I create users via postfixadmin and tried to specify /var/mail/%u/ as the unique directory but of course it complains that dir doesn't exist then. I would have expected it to create it, itself. That would solve that issue.
I have done all sorts of work arounds now to continue operating without it by using /var/empty and all that , but now my squirrelmail doesn't work like it should anymore.
I had a similar problem at one time. It was due to the fact that Dovecot did not have write permissions on the directory so it could not create it. Perhaps your problem is similar.
-- Jerry ✌ Dovecot.user@seibercom.net
Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header.
Speaking of purchasing a dog, never buy a watchdog that's on sale. After all, everyone knows a bargain dog never bites!
On Thu, 2010-07-01 at 18:57 +0200, Marcel Grandemange wrote:
I have done all sorts of work arounds now to continue operating without it by using /var/empty and all that , but now my squirrelmail doesn't work like it should anymore.
Uh. You're now using /var/empty, while originally your mails were in ~/mail/? It sounds like you've just kept breaking your setup worse and worse. Do you have your original configs backed up? I'd suggest starting again from there.
Looking at the original mails, the only problem I see is:
user_query = SELECT maildir, concat('/var/mail/',maildir) AS home, 125 AS uid, 125 AS gid FROM mailbox WHERE username = '%u' AND active = '1'
don't return "maildir", it's ignored.
The /var/mail/ base dir is most likely wrong, if /var/mail/%u contained mboxes. So your mail directories exist somewhere else. Find them. This is why relative home dirs are no longer allowed, who knows where they are..
participants (4)
-
Jerry
-
Marcel Grandemange
-
Steffen Kaiser
-
Timo Sirainen