IMAP

Has anybody seen the behavior where it counts the first unread as 2, and counts properly from there? ie it never shows 1. This is on Yahoo IMAP.

CFBancroft's picture

X-Notifier Options => General => [ ? ] Reset counter when opening messages... check or uncheck?

It works perfect for what I want, but never shows unread message count of 1.

CFBancroft's picture

http://xnotifier.tobwithu.com/dp/comment/9529#comment-9529

 Please use Yahoo website to find it out which is unread... and make it READ... after that IMAP will correct number.

I think it's pretty clear the way I have expressed the problem. But just to be sure, I went ahead and marked all unread. Yahoo said xx being marked unread. X says xx+1. Then marked as read, Yahoo said xx being marked, X says 0 (not 1). If I get a new email now, 1, it will show 2 unread. Looking back to my original post, the question was, has anybody seen this behavior. (I know you are trying to help.)

RpD's picture

Yes, if I define an IMAP script access in X-Notifier 3.5.23 on FF 54.0.1 for my Yahoo account... I get the dreaded mystery "2" in X-Notifier drop-down new email lists, when I have just 1 new email.  My Yahoo account Inbox folder shows a count of (1).
However, my regular Yahoo script still works, although I have the 'Try new Yahoo Mail' prompt... and it properly shows (1) new email in X-Notifier lists.

jeroen's picture

I can replicate makedse's issue with the imap script. It always notifies +1.
On 0 unread it notifies 0.
On 1 unread it notifies 2 (both in inbox and in folder).
I'm still using the Classic Yahoo interface.

jeroen's picture

Did some debugging and found the cause. Easy to solve. I will notify tobwithu.

The script reads a string from the html containg the sequence numbers of unread mail:
"18 23 24" means 3 unread mails, determined by splitting the string by " " (space).

In case of some Yahoo servers the string also contains a space char at the end of the string:
"18 23 24 ", resulting the String.split() method in returning an array of length 4 instead of 3.

I just solved it by using the String.trim() method that removes spaces at start & end of a string:

Line 70:    case ST_DATA+5:
Line 71:       var fnd=aData.match(/\* SEARCH ?(.*)$/m);
Line 72:       var n=0;
Line 73:       if(fnd)  n=fnd[1]?fnd[1].trim().split(" ").length:0;

jeroen's picture

In the meantime you can download it frome here:
IMAP Script  (Left click and download from Dropbox)

Just add it as external script. It will automatically replace the included script with the same name.

jeroen's picture

The fixed IMAP Script will be included in the next release of X-Notifier-Reloaded (3.5.25).

CFBancroft's picture

It works!!! And now I know how to extract the .js files!

legaz's picture

Can you give me little instruction how to add it as external script? Thx.

There is a scripts button right beside the account selector dropdown box. Click on the button and add .js file. The added script will show in the dropdown. In my case I had to delete the IMAP account and re enter.

legaz's picture

..but nothing happened. My 4 yahoo acount icon are stil not appear.

RpD's picture

After adding IMAP script, redefine each problem (Yahoo) account using IMAP.
(You might want to UN-checkmark accounts defined with the Yahoo script.)
Unfortunately, since this is not a dedicated Yahoo script... the icons will not appear. 
(You will probably also have to go to your email website and go into your account settings and set the option for IMAP to allow access from less secure email clients.)
If you right-click the X-Notifier envelope icon, a drop-down list will show the names of the accounts in gray (unchecked), or non-bolded black (no new email), or bold black with a new email count number.  If  you 'hover' your mouse pointer over the X-Notifier envelope icon, a pop-up 'tooltip' will list the accounts in either green with a number (new email) or red (unchecked).

There is a way to add icons for each IMAP defined account... see the user guide:
http://xnotifier.tobwithu.com/dp/node/481
Note... after you type:  about.config  ...in Firefox's address bar, you will get a new page with a Search box.  In the Search box, you can type:  xnotifier   ...(no dash), to filter the config page to just the lines involving xnotifier accounts.

The URL for Yahoo's icon is https://www.yahoo.com/favicon.ico