Re: Bug in IDLE implementation for virtual mailbox

2018-12-17 Thread Pali Rohár
On Monday 17 December 2018 10:50:16 Timo Sirainen wrote:
> On 17 Dec 2018, at 10.44, Pali Rohár  wrote:
> > 
> > On Sunday 16 December 2018 21:55:23 Timo Sirainen wrote:
> >> On 16 Dec 2018, at 21.26, Pali Rohár  wrote:
> >>> 
> >>> Hello!
> >>> 
> >>> I found bug in Dovecot's IDLE implementation when virtual mailbox is in
> >>> use. IDLE does not notify about new emails when email appears in newly
> >>> created mailbox and IDLE was issued in virtual folder which matches "*"
> >>> wildcard and that mailbox was created after opening virtual mailbox.
> >> 
> >> It actually has nothing to do with IDLE specifically. It's just that the 
> >> virtual storage code doesn't try to look for new folders after the virtual 
> >> mailbox is opened.
> >> 
> >>> To get notifications, it is needed to re-open that "All" mailbox again.
> >> 
> >> Right. I don't think this is going to be fixed anytime soon. Quite a lot 
> >> of effort and it can be worked around.
> > 
> > How to workaround it? Imap clients uses either IDLE or STATUS or LIST
> > (with STATUS) commands for checking if there is a new messages.
> > 
> > But none of these commands reports existence of new message until that
> > virtual folder is re-opened.
> 
> I mean, workaround is for the user to just reopen the folder. I think it's 
> not very common for this situation to happen and cause problems?

My setup is that I have sieve filters to put emails from mailing lists,
bugzilla/github/gitlab/... and other projects into separate own mailbox,
based on email headers which these services provides.

So once I get email from new bugzilla, github or gitlab project, then
sieve automatically creates a new mailbox for it. And this happen every
time when I e.g. add a new comment to bugzilla project into which I have
not commented yet.

I'm having permanently opened mutt email client in tmux/screen on "All"
virtual folder to see all new emails.

And basically above bug cause problems in this scenario as I would not
see new emails.

I can re-open "All" mailbox, but first I need to know that new email was
received. And for this I'm using mutt IDLing in All virtual folder.

So it is like chicken and egg problem.

-- 
Pali Rohár
pali.ro...@gmail.com


Re: Bug in IDLE implementation for virtual mailbox

2018-12-17 Thread Timo Sirainen
On 17 Dec 2018, at 10.44, Pali Rohár  wrote:
> 
> On Sunday 16 December 2018 21:55:23 Timo Sirainen wrote:
>> On 16 Dec 2018, at 21.26, Pali Rohár  wrote:
>>> 
>>> Hello!
>>> 
>>> I found bug in Dovecot's IDLE implementation when virtual mailbox is in
>>> use. IDLE does not notify about new emails when email appears in newly
>>> created mailbox and IDLE was issued in virtual folder which matches "*"
>>> wildcard and that mailbox was created after opening virtual mailbox.
>> 
>> It actually has nothing to do with IDLE specifically. It's just that the 
>> virtual storage code doesn't try to look for new folders after the virtual 
>> mailbox is opened.
>> 
>>> To get notifications, it is needed to re-open that "All" mailbox again.
>> 
>> Right. I don't think this is going to be fixed anytime soon. Quite a lot of 
>> effort and it can be worked around.
> 
> How to workaround it? Imap clients uses either IDLE or STATUS or LIST
> (with STATUS) commands for checking if there is a new messages.
> 
> But none of these commands reports existence of new message until that
> virtual folder is re-opened.

I mean, workaround is for the user to just reopen the folder. I think it's not 
very common for this situation to happen and cause problems?



Re: Bug in IDLE implementation for virtual mailbox

2018-12-17 Thread Pali Rohár
On Sunday 16 December 2018 21:55:23 Timo Sirainen wrote:
> On 16 Dec 2018, at 21.26, Pali Rohár  wrote:
> > 
> > Hello!
> > 
> > I found bug in Dovecot's IDLE implementation when virtual mailbox is in
> > use. IDLE does not notify about new emails when email appears in newly
> > created mailbox and IDLE was issued in virtual folder which matches "*"
> > wildcard and that mailbox was created after opening virtual mailbox.
> 
> It actually has nothing to do with IDLE specifically. It's just that the 
> virtual storage code doesn't try to look for new folders after the virtual 
> mailbox is opened.
> 
> > To get notifications, it is needed to re-open that "All" mailbox again.
> 
> Right. I don't think this is going to be fixed anytime soon. Quite a lot of 
> effort and it can be worked around.

How to workaround it? Imap clients uses either IDLE or STATUS or LIST
(with STATUS) commands for checking if there is a new messages.

But none of these commands reports existence of new message until that
virtual folder is re-opened.

-- 
Pali Rohár
pali.ro...@gmail.com


Re: Bug in IDLE implementation for virtual mailbox

2018-12-16 Thread Timo Sirainen
On 16 Dec 2018, at 21.26, Pali Rohár  wrote:
> 
> Hello!
> 
> I found bug in Dovecot's IDLE implementation when virtual mailbox is in
> use. IDLE does not notify about new emails when email appears in newly
> created mailbox and IDLE was issued in virtual folder which matches "*"
> wildcard and that mailbox was created after opening virtual mailbox.

It actually has nothing to do with IDLE specifically. It's just that the 
virtual storage code doesn't try to look for new folders after the virtual 
mailbox is opened.

> To get notifications, it is needed to re-open that "All" mailbox again.

Right. I don't think this is going to be fixed anytime soon. Quite a lot of 
effort and it can be worked around.



Bug in IDLE implementation for virtual mailbox

2018-12-16 Thread Pali Rohár
Hello!

I found bug in Dovecot's IDLE implementation when virtual mailbox is in
use. IDLE does not notify about new emails when email appears in newly
created mailbox and IDLE was issued in virtual folder which matches "*"
wildcard and that mailbox was created after opening virtual mailbox.

This problem is present in version 2.2.34 which is available in Debian
Stretch system with backports.

Reproducer:

1. Create virtual "All" mailbox in Gmail-like style:

$ cat All/dovecot-virtual
*
-Drafts
-Spam
-Trash
  ALL

2. Ensure that (real non-virtual) mailbox "Test" does not exist.

3. Create sieve rule which deliver some email to "Test" mailbox.

  require [ "fileinto", "mailbox" ];
  ...
  fileinto :create "Test";

4. Open dovecot imap connection, select virtual "All" mailbox and then
   enter IDLE command.

4. Send email which matches that sieve filter.

Email will be processed by dovecot sieve. As "Test" mailbox does not
exist, dovecot sieve would first create it and then deliver email into
it.

Now dovecot imap should notify IDLE client that new message into virtual
"All" mailbox was delivered (as it collects emails from all - * -
mailboxes).

But dovecot for some unknown reason does not notify via IDLE that there
is a new email.

To get notifications, it is needed to re-open that "All" mailbox again.

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: PGP signature