Re: Possible to set quota in size and number of messages

2018-08-21 Thread J Doe
Hi Reio and list,

It appears placing it at the end of the quota rules and then manually 
recalculating the quotas via doveadm has solved the problem!

Configuration:

plugin {

quota = dict:User quota::file:%h/dovecot-quota

quota_rule = *:storage=10G

quota_rule1 = INBOX/Inbox:storage=+30M
quota_rule2 = INBOX/Trash:storage=+30M
quota_rule3 = INBOX/Deleted Messages:storage=+30M

quota_rule4 = *:messages=10
}

Recalculate quotas:

$ sudo doveadm quota recalc -u 

Restart Dovecot and Apple Mail.

Thanks,

- J

Possible to set quota in size and number of messages

2018-08-21 Thread J Doe
Hello,

I am using Dovecot 2.2.33.2 and am attempting to set quotas on mailboxes.

I currently have the following:

plugin {
quota = dict:User quota::file:%h/dovecot-quota

quota_rule = *:storage=10G

quota_rule1 = INBOX/Inbox:storage=+30M
quota_rule2 = INBOX/Trash:storage=+30M
quota_rule3 = INBOX/Deleted Messages:storage=+30M
}

If I check the quota via Apple Mail version 11.5 (3445.9.1) on Mac OS X 10.13.6 
by selecting “Get Account Info” it displays the correct quota size in bytes but 
also states “0 messages” (in that it states I can store 0 messages).

Is there a way to signify to an IMAP client that the quota should be _EITHER_ 
10 GB or 100,000 messages, just so a user doesn’t see that they can store a 
total of 0 messages ?

My initial thought was to alter the previous quota settings by adding:

quota_rule4 = INBOX:messages=10

… and restarting Dovecot and Apple Mail, but upon checking the quota’s on the 
user’s account, I still see that a user can store 10 GB or 0 messages.

Thanks,

- J

Re: lazy expunge folder delete bug

2018-08-21 Thread Jan-Pieter Cornet

Answering my own post...

On 22-6-18 16:52, Jan-Pieter Cornet wrote:

There's a bug in "folder delete" for lazy expunge, type "1 namespace", as 
descibed on https://wiki2.dovecot.org/Plugins/Lazyexpunge
When trying to delete a mailbox that still has messages in it, but that has no 
EXPUNGED/ counterpart, the process hangs after the imap "DELETE" command, 
and the following appears in the log file after a 60s timeout:

Jun 22 15:48:15 userimap6 dovecot: imap(xtra30): Error: Couldn't create mailbox 
list lock /var/mail/.8d1/index/4/03/xtra30/index/mailboxes.lock: 
file_create_locked(/var/mail/.8d1/index/4/03/xtra30/index/mailboxes.lock) 
failed: flock(/var/mail/.8d1/index/4/03/xtra30/index/mailboxes.lock, 
write-lock) failed: Timed out after 60 seconds (BUG: lock is held by our own 
process)

[...detailed example deleted...]

Seems the delete operation locks the mailbox list, and then the expunge create 
hits the same lock. Is this something we can fix by changing settings? Eg use 
another location for the expunge lock?


Yes, that is indeed the solution.

I now set the VOLATILEDIR in the Expunged namespace to another directory, and 
it's no longer a problem to delete an entire folder that still contains mails.

The full setting of the location for the Expunged namespace is now:

location = 
mdbox:$home/:INDEX=$index/:MAILBOXDIR=expunged:LISTINDEX=expunged.list.index:SUBSCRIPTIONS=expunged.subscriptions:VOLATILEDIR=$index/expunged-volatile

(The variables $home and $index are expanded by the userdb before it returns 
this setting to dovecot).

--
Jan-Pieter Cornet 
Systeembeheer XS4ALL Internet bv
www.xs4all.nl



signature.asc
Description: OpenPGP digital signature


lmtp Panic Buffer write out of range

2018-08-21 Thread Gabriele Nencioni
Hi all,
as described here:
https://www.dovecot.org/pipermail/dovecot/2018-July/112173.html

we are experiencing the same error on dovecot version 2.3.2.1
while it never occurs on an old version as 2.2.15


It followings the error logs:

On an upgraded dovecot backend:
Aug 21 12:03:51 backend20 dovecot:
lmtp(te...@internalinboundcm.eu): Panic: Buffer
write out of range (789 + 18446744073709551606)
/var/log/dovecot_lmtp_20180821.12.log-Aug 21 12:03:51 monti-backend20
dovecot: lmtp(te...@internalinboundcm.eu):
Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0xcb851)
[0x7f78e6f0a851] -> /usr/lib/dovecot/libdovecot.so.0(+0xcb8e9)
[0x7f78e6f0a8e9] -> /usr/lib/dovecot/libdovecot.so.0(i_fatal+0)
[0x7f78e6e78851] -> /usr/lib/dovecot/libdovecot.so.0(buffer_write+0x131)
[0x7f78e6f04871] ->
/usr/lib/dovecot/libdovecot-sieve.so.0(rfc2822_header_append+0xcf)
[0x7f78e531613f] -> /usr/lib/dovecot/libdovecot-sieve.so.0(+0x7d35b)
[0x7f78e531335b] ->
/usr/lib/dovecot/libdovecot-sieve.so.0(edit_mail_header_add+0x1b)
[0x7f78e531525b] -> /usr/lib/dovecot/libdovecot-sieve.so.0(+0x73014)
[0x7f78e5309014] ->
/usr/lib/dovecot/libdovecot-sieve.so.0(sieve_interpreter_continue+0x81)
[0x7f78e52d2a11] ->
/usr/lib/dovecot/libdovecot-sieve.so.0(sieve_interpreter_run+0x2b)
[0x7f78e52d2c7b] -> /usr/lib/dovecot/libdovecot-sieve.so.0(+0x51000)
[0x7f78e52e7000] ->
/usr/lib/dovecot/libdovecot-sieve.so.0(sieve_multiscript_run+0x3a)
[0x7f78e52e7eba] ->
/usr/lib/dovecot/modules/lib90_sieve_plugin.so(+0x38f0) [0x7f78e554e8f0]
-> /usr/lib/dovecot/libdovecot-lda.so.0(mail_deliver+0xf0)
[0x7f78e750da30] -> dovecot/lmtp [81.88.49.172
DATA](lmtp_local_data+0x4f1) [0x5582554451d1] -> dovecot/lmtp
[81.88.49.172 DATA](cmd_data_continue+0x243) [0x558255443ee3] ->
/usr/lib/dovecot/libdovecot.so.0(+0x4c402) [0x7f78e6e8b402] ->
/usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x69) [0x7f78e6f228a9]
-> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0x109)
[0x7f78e6f24199] ->
/usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x52)
[0x7f78e6f229b2] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x38)
[0x7f78e6f22bc8] ->
/usr/lib/dovecot/libdovecot.so.0(master_service_run+0x13)
[0x7f78e6e9cff3] -> dovecot/lmtp [81.88.49.172 DATA](main+0x240)
[0x558255442f70] ->
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7f78e6ac02e1]
-> dovecot/lmtp [81.88.49.172 DATA](_start+0x2a) [0x5582554430ba]

while once the user te...@internalinboundcm.eu has been moved on an old
dovecot backend, with the "doveadm director move" command the message
has been properly delivered at next retry attempt:
Aug 21 12:32:31 backend01 dovecot:
lmtp(te...@internalinboundcm.eu): copy from
: box=Spam, uid=1,
msgid=
Aug 21 12:32:31 backend01 dovecot:
lmtp(te...@internalinboundcm.eu):
Zv32Lzbqe1tSLQAAF5Yx/g: sieve:
msgid=: stored
mail into mailbox 'Spam'


As you can see the message was detected as spam

Let me know if you need more info or details (such us the original
message or the sieve filter that trigger the problem)

Thanks in advance
Regards
-- 
Gabriele Nencioni
System Administrator
eml gabriele.nenci...@register.it