So the subject kinda sums it up.
I have a link in the header of my site called "Mail" which leads to
the roundcube system, but what I'd like is if you have new emails it
says "Mail (##)" with the number of unread messages. The biggest (or
maybe just first) hurdle I see is in authentication. The whole point
of this is so you don't have to click mail and login if you don't
have any new messages to begin with, so if they don't login how do
you know what the account is? Well, all users must be logged in to
my site to begin with and their usernames/passwords are the same for
both the site and the roundcube system, so if there is some way to
pass a username/password into some roundcube function and check for
unread messages, that's the most logical solution I see, but even if
that's possible I don't know the code for roundcube well enough to do
that?
Ideas/suggestions/comments? Has anyone done this or tried to? Or
perhaps a better question is 'is something like this planned for a
future release?'
Thanks,
Tim
I don't see how this would be a usefull future for anyone else but you ;) If you have physical access to the IMAP server you can do this with a simple systemcall:
find /home/username/Maildir/cur -maxdepth 1 -type f -regex '.*[^S]$'|wc -l
If you don't have that access, or want a proper solution you will probably need to hack the IMAP libraries yourself; I can't imagine that that will be too hard though :)
Timothy Martin wrote:
So the subject kinda sums it up.
I have a link in the header of my site called "Mail" which leads to the roundcube system, but what I'd like is if you have new emails it says "Mail (##)" with the number of unread messages. The biggest (or maybe just first) hurdle I see is in authentication. The whole point of this is so you don't have to click mail and login if you don't have any new messages to begin with, so if they don't login how do you know what the account is? Well, all users must be logged in to my site to begin with and their usernames/passwords are the same for both the site and the roundcube system, so if there is some way to pass a username/password into some roundcube function and check for unread messages, that's the most logical solution I see, but even if that's possible I don't know the code for roundcube well enough to do that?
Ideas/suggestions/comments? Has anyone done this or tried to? Or
perhaps a better question is 'is something like this planned for a
future release?'Thanks,
Tim
Ok that command works, however it appears to not update. In other
words if I run it now it returns 0. If i send the account that I'm
checking a new email it still reads 0. If I login through the normal
roundcube system and log back out, it now reads 1. How can I get it
to update the count without logging in and back out?
Thanks again, Tim
On Dec 6, 2005, at 1:33 PM, Sjon wrote:
I don't see how this would be a usefull future for anyone else but
you ;) If you have physical access to the IMAP server you can do
this with a simple systemcall:find /home/username/Maildir/cur -maxdepth 1 -type f -regex '.*[^S] $'|wc -l
If you don't have that access, or want a proper solution you will
probably need to hack the IMAP libraries yourself; I can't imagine
that that will be too hard though :)Timothy Martin wrote:
So the subject kinda sums it up. I have a link in the header of my site called "Mail" which leads
to the roundcube system, but what I'd like is if you have new
emails it says "Mail (##)" with the number of unread messages.
The biggest (or maybe just first) hurdle I see is in
authentication. The whole point of this is so you don't have to
click mail and login if you don't have any new messages to begin
with, so if they don't login how do you know what the account
is? Well, all users must be logged in to my site to begin with
and their usernames/passwords are the same for both the site and
the roundcube system, so if there is some way to pass a username/ password into some roundcube function and check for unread
messages, that's the most logical solution I see, but even if
that's possible I don't know the code for roundcube well enough to
do that? Ideas/suggestions/comments? Has anyone done this or tried to?
Or perhaps a better question is 'is something like this planned
for a future release?' Thanks, Tim
Ideas/suggestions/comments? Has anyone done this or tried to? Or perhaps a better question is 'is something like this planned for a future release?'
I'd just use the Ilohamail IMAP library for that easy task. Would be kind of an overkill to use roundcube as a wrapper to get the mailcount.
Regards, Niels
The line given was just a quick, untested one; but if you want to continue using something like that you might indeed need to change some things. You probably need to add the mails in /home/username/Maildir/new to the totalcount.
Unfortunatly I cannot find a quicker way using some quick Google terms
Timothy Martin wrote:
Ok that command works, however it appears to not update. In other
words if I run it now it returns 0. If i send the account that I'm
checking a new email it still reads 0. If I login through the normal
roundcube system and log back out, it now reads 1. How can I get it to update the count without logging in and back out?Thanks again, Tim
On Dec 6, 2005, at 1:33 PM, Sjon wrote:
I don't see how this would be a usefull future for anyone else but
you ;) If you have physical access to the IMAP server you can do this with a simple systemcall:find /home/username/Maildir/cur -maxdepth 1 -type f -regex '.*[^S] $'|wc -l
If you don't have that access, or want a proper solution you will
probably need to hack the IMAP libraries yourself; I can't imagine
that that will be too hard though :)Timothy Martin wrote:
So the subject kinda sums it up. I have a link in the header of my site called "Mail" which leads to
the roundcube system, but what I'd like is if you have new emails it says "Mail (##)" with the number of unread messages. The biggest (or maybe just first) hurdle I see is in authentication.
The whole point of this is so you don't have to click mail and login if you don't have any new messages to begin with, so if they don't login how do you know what the account is? Well, all users must be logged in to my site to begin with and their usernames/passwords are the same for both the site and the roundcube system, so if there is some way to pass a username/ password into some roundcube function and check for unread
messages, that's the most logical solution I see, but even if
that's possible I don't know the code for roundcube well enough to
do that? Ideas/suggestions/comments? Has anyone done this or tried to? Or
perhaps a better question is 'is something like this planned for a
future release?' Thanks, Tim
After reading the specifications I am pretty sure this will work for you:
expr find /home/sjonh/Maildir/cur -maxdepth 1 -type f -regex '.*,[^S]*$'|wc -l
+ find /home/sjonh/Maildir/new -maxdepth 1 -type f|wc -l
Regards, Sjon
On Tue, 06 Dec 2005 22:55:16 +0100, Sjon roundcube.net@spider007.net wrote:
The line given was just a quick, untested one; but if you want to continue using something like that you might indeed need to change some things. You probably need to add the mails in /home/username/Maildir/new to the totalcount.
Unfortunatly I cannot find a quicker way using some quick Google terms
Timothy Martin wrote:
Ok that command works, however it appears to not update. In other words if I run it now it returns 0. If i send the account that I'm checking a new email it still reads 0. If I login through the normal roundcube system and log back out, it now reads 1. How can I get it to update the count without logging in and back out?
Thanks again, Tim
On Dec 6, 2005, at 1:33 PM, Sjon wrote:
I don't see how this would be a usefull future for anyone else but you ;) If you have physical access to the IMAP server you can do this with a simple systemcall:
find /home/username/Maildir/cur -maxdepth 1 -type f -regex '.*[^S] $'|wc -l
If you don't have that access, or want a proper solution you will probably need to hack the IMAP libraries yourself; I can't imagine that that will be too hard though :)
Timothy Martin wrote:
So the subject kinda sums it up. I have a link in the header of my site called "Mail" which leads to the roundcube system, but what I'd like is if you have new emails it says "Mail (##)" with the number of unread messages. The biggest (or maybe just first) hurdle I see is in authentication. The whole point of this is so you don't have to click mail and login if you don't have any new messages to begin with, so if they don't login how do you know what the account is? Well, all users must be logged in to my site to begin with and their usernames/passwords are the same for both the site and the roundcube system, so if there is some way to pass a username/ password into some roundcube function and check for unread messages, that's the most logical solution I see, but even if that's possible I don't know the code for roundcube well enough to do that? Ideas/suggestions/comments? Has anyone done this or tried to? Or perhaps a better question is 'is something like this planned for a future release?' Thanks, Tim