Ok, so it appears that this entry in my mtab was causing dovecot to get
confused:

> rootfs on / type rootfs (rw)

So here is a little patch to make dovecot ignore filesystems of type
"rootfs". This seems to fix the problem for me as it just finds the
proper mtab entry for the root filesystem.

On 08/07/10 14:44, Patrick McLean wrote:
> This is on the root filesystem on the machine, if that has any bearing
> on the problem.
> 
> On 07/08/10 12:03 PM, Patrick McLean wrote:
>> Hi,
>>
>> I have a machine running dovecot 2.0 rc4 and I can't seem to get the
>> imap_quota plugin working, every time I try to read the quotas, I get
>> the following in my log:
>>
>>> Aug  7 11:58:43 talyn dovecot: imap(chutz): Error: quotactl(Q_GETQUOTA, 
>>> rootfs) failed: No such file or directory
>>> Aug  7 11:59:53 talyn dovecot: imap(chutz): Error: quotactl(Q_GETQUOTA, 
>>> rootfs) failed: No such file or directory
>>> Aug  7 11:59:54 talyn dovecot: imap(chutz): Error: quotactl(Q_GETQUOTA, 
>>> rootfs) failed: No such file or directory
>>
>> (Once for each try)
>>
>> Here is the output of dovecot -n:
>>> # 2.0.rc4: /etc/dovecot/dovecot.conf
>>> # OS: Linux 2.6.34-gentoo-r3 i686 Gentoo Base System release 2.0.1 
>>> listen = *
>>> mail_location = mdbox:~/.mdbox
>>> mail_plugins = acl quota zlib trash imap_quota
>>> managesieve_notify_capability = mailto
>>> managesieve_sieve_capability = comparator-i;octet 
>>> comparator-i;ascii-casemap fileinto reject envelope encoded-character 
>>> vacation subaddress comparator-i;ascii-numeric relational regex imap4flags 
>>> copy include variables body enotify environment mailbox date spamtest 
>>> spamtestplus virustest
>>> passdb {
>>>   args = *
>>>   driver = pam
>>> }
>>> plugin {
>>>   quota = fs:User quota:user
>>>   quota_warning = storage=80%% quota-warning 80 %u
>>>   sieve = ~/.dovecot.sieve
>>>   sieve_dir = ~/.sieve
>>> }
>>> protocols = imap lmtp
>>> service auth {
>>>   unix_listener /var/spool/postfix/private/auth {
>>>     group = postfix
>>>     mode = 0660
>>>     user = postfix
>>>   }
>>> }
>>> ssl_cert = </etc/ssl/dovecot/server.pem
>>> ssl_key = </etc/ssl/dovecot/server.key
>>> userdb {
>>>   driver = passwd
>>> }
>>> verbose_proctitle = yes
>>> protocol lda {
>>>   mail_plugins = sieve quota
>>> }
diff -ur dovecot-2.0.rc4.orig/src/lib/mountpoint.c 
dovecot-2.0.rc4/src/lib/mountpoint.c
--- dovecot-2.0.rc4.orig/src/lib/mountpoint.c   2010-08-08 01:01:56.000000000 
-0400
+++ dovecot-2.0.rc4/src/lib/mountpoint.c        2010-08-08 01:16:09.000000000 
-0400
@@ -47,6 +47,12 @@
 #  define MNTTYPE_NFS "nfs"
 #endif
 
+/* Linux sometimes has mtab entries for "rootfs" as well as the real root
+ * entries, this causes failures reading the quotas on root
+ */
+#ifndef MNTTYPE_ROOTFS
+#  define MNTTYPE_ROOTFS "rootfs"
+#endif
 
 int mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r)
 {
@@ -191,7 +197,8 @@
        }
        while ((ent = getmntent(f)) != NULL) {
                if (strcmp(ent->mnt_type, MNTTYPE_SWAP) == 0 ||
-                   strcmp(ent->mnt_type, MNTTYPE_IGNORE) == 0)
+                   strcmp(ent->mnt_type, MNTTYPE_IGNORE) == 0 ||
+                   strcmp(ent->mnt_type, MNTTYPE_ROOTFS) == 0)
                        continue;
 
                if (stat(ent->mnt_dir, &st2) == 0 &&

Reply via email to