Bug 14 - "Run command when new mail arrives" doesn't work as expected with IMAP folders
Summary: "Run command when new mail arrives" doesn't work as expected with IMAP folders
Status: RESOLVED WONTFIX
Alias: None
Product: Sylpheed-Claws (GTK1)
Classification: Unclassified
Component: Folders/IMAP (show other bugs)
Version: 0.8.9
Hardware: PC Linux
: P1 enhancement
Assignee: Melvin Hadasht
URL:
Depends on: 19
Blocks: 704
  Show dependency tree
 
Reported: 2003-01-08 10:56 UTC by Keith Edmunds
Modified: 2005-06-26 00:27 UTC (History)
0 users

See Also:


Attachments
patch to current cvs (8.92 KB, patch)
2003-01-12 04:03 UTC, Melvin Hadasht
no flags Details | Diff
Only count the number of new messages since last check (934 bytes, patch)
2003-01-14 01:43 UTC, Melvin Hadasht
no flags Details | Diff

Description Keith Edmunds 2003-01-08 10:56:42 UTC
I have "Run command when new mail arrives" set to play a sound. "After
autochecking" and "after manual checking" are both checked. 

Message|Get new mail - always plays the sound, even when there is no new mail

Message|Get from all acounts - works as expected.
Comment 1 Melvin Hadasht 2003-01-08 11:04:03 UTC
Are you using IMAP?
Comment 2 Keith Edmunds 2003-01-08 11:13:01 UTC
Yes, using IMAP.
Comment 3 Melvin Hadasht 2003-01-08 11:32:50 UTC
Indeed, the new mail notification does not work with IMAP folder. I'll 
look into this.
Comment 4 Melvin Hadasht 2003-01-12 04:03:44 UTC
Created attachment 1 [details]
patch to current cvs
Comment 5 Melvin Hadasht 2003-01-12 04:05:10 UTC
Please try this patch. My IMAP server does not report new mail, only 
unread mail so I cannot test it. At least, it won't report new mail if 
there is none.
Comment 6 Keith Edmunds 2003-01-13 23:41:50 UTC
It works to the extent that the "Run command when new mail arrives" runs only
when there is new mail. A possible problem is that  if the mail is left unread
then the command runs every time a new mail check is run, so it becomes a "you
still have new mail" rather than "new mail has arrived" command. 

However, I'm not sure that this is easy to fix. It isn't appropriate for SC to
mark the messages as merely unread (as opposed to new), but the only other way
it can resolve this issue is to keep a track of how many new message there are
in each folder, and only run the "new mail has arrived" command when the new
mail count of any one or more folders increases. A lot of work for a minor
cosmetic feature - but at the moment, with any new mail, my PC bleeps once a
minute. 
Comment 7 Melvin Hadasht 2003-01-14 01:42:05 UTC
Right. Please test the next patch (against current cvs, or against the first
patch). 
Comment 8 Melvin Hadasht 2003-01-14 01:43:50 UTC
Created attachment 2 [details]
Only count the number of new messages since last check

Patch to first patch or to cvs.
Please test.
Comment 9 Keith Edmunds 2003-01-14 03:17:49 UTC
Works well, thanks.
Comment 10 Keith Edmunds 2003-01-14 03:21:59 UTC
I spoke too soon - I'm still getting a notification on every mail check. Let me
investigate and come back to you.
Comment 11 Keith Edmunds 2003-01-14 05:14:40 UTC
OK, update. Initially it looked as if the latest patch worked. However, when I
am composing a mail it is autosaved to Drafts every 50 chars; during this time
my new mail alert fires every minute, even though the newmail count is not
increasing (so each time the mail is saved to Drafts it seems to be seen as a
new mail). New mails in Drafts are, of course, a red herring. What I think is
happening is this:

1. Start composing new mail
2. After 50 chars it is saved to Drafts
3. New mail check runs
4. When next character is typed in new mail, it is no longer marked as new
5. After 50 chars, mail is saved again to Drafts
6. New mail check runs, finds 'new' mail

I know that that sounds strange, but that is what seems to be happening. If I
can help at all with more information let me know.
Comment 12 Melvin Hadasht 2003-01-14 06:24:16 UTC
(Are your source patched? Or is your Drafts a subfolder of INBOX?

My IMAP's drafts folder does not get checked, unless I'll put it as a subfolder
of INBOX. In that case, I don't have the problem you describe, probably because
my IMAP server does not report \Recent messages. )

The draft messages are marked as \Seen, so they should not be considered as new
messages even if they are \Recent.

For the moment, I'll disable IMAP new mail notification in CVS, until I fix this.

Note You need to log in before you can comment on or make changes to this bug.