Re: [Dovecot] mail_log plugin logs UTF-8 mailbox name

2012-07-11 Thread Ewald Dieterich

On 07/11/12 19:11, Timo Sirainen wrote:

On 11.7.2012, at 15.42, Ewald Dieterich wrote:


A small bug in the mail_log plugin:

[...] copy from INBOX: box=INBOX.Euro €, [...]


I think the UTF8 name is more correct here


[...] copy from Euro &IKw-: box=INBOX, [...]


and I should change this instead.


Here is another one:

$ doveadm mailbox create -u 52002149-0001 "INBOX.Umlaut ä"
doveadm(52002149-0001): Info: Mailbox created: Umlaut &AOQ-

And again from the mail_log plugin:

[...] Mailbox deleted: Umlaut &AOQ-


Just because IMAP protocol uses mUTF7 doesn't mean that it should be
visible anywhere else.


Well, it used to be mUTF-7 everywhere, and now all the scripts that use
doveadm are broken. Also, it used to be so easy to go from a protocol
snippet to the filesystem and then to a doveadm command line. Just copy
and paste. But I'm just complaining ;-)


(You can already use UTF8 for mailbox names on the filesystem.)


You mean there is a configuration option in Dovecot? I didn't know that.


[Dovecot] MySQL dict issues

2012-07-11 Thread l...@airstreamcomm.net
Testing using the mysql dict for quota storage 
(dovecot-2.0.12-2_127.el5), and ran into a couple issues.  First is a 
permissions issue:


dovecot: lmtp(26786, d...@test.tld):  Error: 
net_connect_unix(/var/run/dovecot/dict) failed: Permission denied 
(euid=5000() egid=5000() missing +r perm: 
/var/run/dovecot/dict, euid is not dir owner)


The file /var/run/dovecot/dict is listed with srw--- perms.  I 
changes the perms to srwrwx and it works, but I would like to figure 
out how to configure properly to run with the uid and gid 5000 as this 
is the user for virtual mail.


The second issue is that two identical rows are created in the mysql 
database for each user quota.  The next message delivered updates both 
rows.  Here is my quota config:


90-quota.conf:

plugin {
  quota_rule = *:storage=10G
  quota_rule2 = Trash:storage=+10%
}
plugin {
  quota = dict:user::proxy::userquota
}
dict {
  userquota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
}

dovecot-dict-sql.conf.ext:

connect = host=a.b.c.d dbname=mail user=user password=derp
map {
  pattern = priv/quota/storage
  table = domain_user_quotas
  username_field = username
  value_field = bytes
}
map {
  pattern = priv/quota/messages
  table = domain_user_quotas
  username_field = username
  value_field = message_count
}

The last issue might be a documentation omission.  Dovecot warned me 
that the mysql user did not have DELETE privileges on the quota table:


dovecot: dict: Error: sql dict: commit failed: DELETE command denied to 
user 'user'@'a.b.c.d' for table 'domain_user_quotas'


The quota dict documentation (at http://wiki2.dovecot.org/Quota/Dict) 
does not mention DELETE being needed:


MySQL uses the following queries to update the quota. You need suitable 
privileges.


INSERT INTO table (bytes,username) VALUES ('112497180','f...@spam.dom') ON 
DUPLICATE KEY UPDATE bytes='112497180';
INSERT INTO table (messages,username) VALUES ('1743','f...@spam.dom') ON 
DUPLICATE KEY UPDATE messages='1743';
UPDATE table SET bytes=bytes-14433,messages=messages-2 WHERE username = 
'f...@spam.dom';




Re: [Dovecot] mail_log plugin logs UTF-8 mailbox name

2012-07-11 Thread Timo Sirainen
On 11.7.2012, at 15.42, Ewald Dieterich wrote:

> A small bug in the mail_log plugin:
> 
> When I copy a mail from the inbox to a mailbox with special characters,
> the mailbox name is logged in UTF-8:
> 
> [...] copy from INBOX: box=INBOX.Euro €, [...]

I think the UTF8 name is more correct here

> I guess the name should be in mUTF-7, like it is done when I copy the
> other way round:
> 
> [...] copy from Euro &IKw-: box=INBOX, [...]

and I should change this instead.

Just because IMAP protocol uses mUTF7 doesn't mean that it should be visible 
anywhere else. (You can already use UTF8 for mailbox names on the filesystem.)



[Dovecot] mail_log plugin logs UTF-8 mailbox name

2012-07-11 Thread Ewald Dieterich

A small bug in the mail_log plugin:

When I copy a mail from the inbox to a mailbox with special characters,
the mailbox name is logged in UTF-8:

[...] copy from INBOX: box=INBOX.Euro €, [...]

I guess the name should be in mUTF-7, like it is done when I copy the
other way round:

[...] copy from Euro &IKw-: box=INBOX, [...]