[spambayes-bugs] [ spambayes-Feature Requests-774978 ] Hide envelope icon when only spam received

SourceForge.net noreply at sourceforge.net
Sun Dec 5 10:38:23 CET 2004


Feature Requests item #774978, was opened at 2003-07-21 14:42
Message generated for change (Comment added) made by mkabcde
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498106&aid=774978&group_id=61702

Category: Outlook
Group: None
Status: Open
Priority: 5
Submitted By: Andrew Zaikin (ghuron)
Assigned to: Mark Hammond (mhammond)
Summary: Hide envelope icon when only spam received

Initial Comment:
When during automatic receiving session only spam 
messages was received it is desired to remove envelope 
icon from tray. Probably this option should be switched 
off by default with the possibility to switch it on from 
the configuration file.

----------------------------------------------------------------------

Comment By: Martin Kirchner (mkabcde)
Date: 2004-12-05 10:38

Message:
Logged In: YES 
user_id=1171109

Hello everybody!
I wrote my own vba-macro which checks ALL my Outlook 
folders under "Inbox". The macro "CountUnreadMessages" 
is called from Application_NewMail in ThisOutlookSession. 
It has also the possibility to skip certain folders. Just 
rename the folder and add "_" as last character of the 
name. I know this solution is not quite sophisticated 
however it works fine. The program triggers a beep but 
you could also open a messagebox or like I did invoke the 
assistant which does some funny stuff.

I solved the problem with the normal Outlook notification 
by deactivating the "New Mail"-sound and always hiding 
the icon in the SysTray.

HTH Martin
If you have problems just ask.

Here the code (Maybe you have to tune the waiting time 
according to the number of messages you get):

Public Sub CountUnreadMessages()
    On Error GoTo ErrorHandler
    Wait.WaitTime (10) 'Wait 10 seconds to allow 
SpamBayes to do its work
    Dim Inbox As Outlook.MAPIFolder
    Dim Subfolders As Outlook.MAPIFolder
    Set Inbox = GetNamespace("MAPI").
GetDefaultFolder(olFolderInbox)
    Dim nUnreadMessages As Integer
    nUnreadMessages = 
CountUnreadMessagesInFolder(Inbox)
    Set Inbox = Nothing
    If nUnreadMessages > 0 Then
        'do whatever you want
        MsgBow("You have " & nUnreadMessages & " 
messages")
        Beep
    End If
Exit Sub

ErrorHandler:
    MsgBox Err.Number & " :" & Error(Err.Number)
    Close #1
    Set Inbox = Nothing
End Sub


Private Function CountUnreadMessagesInFolder(oFolder 
As Outlook.MAPIFolder) As Integer
    'Folders which shall not be searched must end with 
"_". Their subfolders will not be searched
    If Right(oFolder.Name, 1) = "_" Then
        CountUnreadMessagesInFolder = 0
        Exit Function
    End If
    'count mails in subfolders
    Dim i As Integer
    Dim nUnreadMailsSubFolders As Integer
    For i = 1 To oFolder.Folders.count
        nUnreadMailsSubFolders = nUnreadMailsSubFolders 
+ CountUnreadMessagesInFolder(oFolder.Folders(i))
    Next i
    'count mails in current folder
    Dim j As Integer
    Dim nUnreadMailsHere As Integer
    Dim oCurMailItem As MailItem
    For j = 1 To oFolder.Items.count
        If oFolder.Items(j).UnRead Then nUnreadMailsHere 
= nUnreadMailsHere + 1
    Next j
    CountUnreadMessagesInFolder = 
nUnreadMailsSubFolders + nUnreadMailsHere
End Function


Public Sub WaitTime(sec As Integer)
    Dim Start, Ende, Gesamtdauer
    Start = Timer    'set starting time
    Do While Timer < Start + sec
        DoEvents    'process other events
    Loop
End Sub


----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2004-11-29 22:45

Message:
Logged In: YES 
user_id=552329

Noting dupe in:

[ 1075410 ] Mail notification if new ham detected
https://sourceforge.net/tracker/index.php?func=detail&aid=1075410&group_id=61702&atid=498106

----------------------------------------------------------------------

Comment By: Kenny Pitt (kpitt)
Date: 2004-09-30 17:26

Message:
Logged In: YES 
user_id=859086

Thanks for the input, but the real problem is not being able
to clear the icon (I've already got Python code based on an
earlier comment that will do that) but rather knowing *when*
to clear the icon.

The problem is that SpamBayes only knows about a small
subset of the Outlook mail folders.  A user can configure
Outlook rules to move messages to other folders that
SpamBayes doesn't know about, so it is difficult for
SpamBayes to be certain when there are *no* other unread
messages anywhere in Outlook.

----------------------------------------------------------------------

Comment By: Gerard Roche (balfbalf)
Date: 2004-09-30 02:39

Message:
Logged In: YES 
user_id=363795

Have you seen this:
http://www.outlookcode.com/d/code/clearenvicon.htm

It maybe able to help with this bloody annoying problem. :)

Cheers,
Gerard

----------------------------------------------------------------------

Comment By: JJJJust (jjjjust)
Date: 2004-08-04 14:10

Message:
Logged In: YES 
user_id=1093702

A simpler workaround (Tested only in Outlook 2000) is to read 
all your non-spam e-mail first, then you can look at your 
spam e-mail, then you can right click on your Junk E-Mail 
folder and click Mark All as Read. That gets rid of the 
envelope for me. Tedious, yes... but it works.

----------------------------------------------------------------------

Comment By: edaly (edaly)
Date: 2004-06-05 02:38

Message:
Logged In: YES 
user_id=1057156

Any news on when we can expect this feature?

I recently installed SpamBayes and it's a great program but the 
envelope icon is killing me.  I like to answer email right away so 
I find myself constantly flipping to Outlook only to find no new 
messages there because it was spam.

Interestingly, my old beta copy of Cloudmark SpamNet doesn't 
have this problem.  It removes the envelope icon when the 
message is deleted and marked as read.

Even if I had an option in SpamBayes to remove the envelope 
icon whenever SpamBayes detected spam (regardless of 
whether there was other new mail there or not), I would turn 
it on.

Please please please get this feature in soon!

thanks,

Erin Daly

----------------------------------------------------------------------

Comment By: Kenny Pitt (kpitt)
Date: 2004-03-02 16:20

Message:
Logged In: YES 
user_id=859086

Notification sounds for SpamBayes have already been 
implemented, but not integrated into the release version yet. 
Sounds like we're getting enough requests for this that we 
might want to merge it, at least as a "config-file-only" 
experimental option.

See Patch #858925:
http://sourceforge.net/tracker/index.php?
func=detail&aid=858925&group_id=61702&atid=498105

----------------------------------------------------------------------

Comment By: Mark F Garrison (garrmark)
Date: 2004-03-02 14:50

Message:
Logged In: YES 
user_id=726010

Just turn off the outlook notification (under advanced e-mail 
options).  I don't use sound much so I didn't add that, but it's 
probably not too hard.

----------------------------------------------------------------------

Comment By: Bob Hamans (bchamans)
Date: 2004-03-01 23:46

Message:
Logged In: YES 
user_id=866934

Mark, 

I just downloaded your program and it seems to work fine. 
Unfortionately i still need the macro (see below) to get rid of 
the original outlook mail notification. This macro also 
eliminates all sounds of incoming mail/ham. Isn't it possible to 
do this all in your program? 
To have a audible notification on ham and silence on spam?
No icon (not even a blue or black one) when spam is received 
and a mail notification when ham is received?

I very much like that i can now see the number of emails i 
have received in contrast to "You have unread items" which is 
the normal outlook notification.

Keep up the good work!

----------------------------------------------------------------------

Comment By: Mark F Garrison (garrmark)
Date: 2004-03-01 21:31

Message:
Logged In: YES 
user_id=726010

I wrote a C# program to replace the outlook notify icon w/ 
my own.  The code for this is at 
http://codeproject.com/csharp/gmcdoexmail.asp

----------------------------------------------------------------------

Comment By: Bob Hamans (bchamans)
Date: 2003-10-13 14:29

Message:
Logged In: YES 
user_id=866934

Reacting on all before. Would'nt it be the best option to allow 
a rule or macro to be defined that can be runned after spam 
and ham is processed? In other words an extra option in the 
spambayes filtering dialog. 

[Move] spam to folder [...]
[X] Mark spam as read
[X] Process following rule or macro [...]

Indeed the macro proposed by Ghuron does exactly that. It 
does not block the sounds though. More info on the macro on 
http://www.slipstick.com/dev/code/clearenvicon.htm#info

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-10-10 00:33

Message:
Logged In: YES 
user_id=552329

Mark - what do you think of the idea of providing our own 
icon in the tray (and a sound) when we classify mail as [user-
defined selection of ham/unsure/spam]?  In your opinion, do 
you think that we could successfully determine when these 
messages were read so that we could clear the flag?  Would 
you be opposed to this rather off-topic feature appearing in 
the plug-in?

If your comments are positive, then I might try and write 
some code to do this at some point, if only to stop the 
incessant requests for this feature &lt;wink&gt;.

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-10-10 00:30

Message:
Logged In: YES 
user_id=552329

>From the list:
My outlook always plays a sound when new mails do arrive - 
also when new spam comes in. Since 90% of my mails are 
spam, this is really nerving. If spambayes could give out a 
sound when no-spam-mails arrive, then I could switch off the 
the standard-sound of outlook and only Spambayes 
reports &quot;good&quot; mails. Then we again have a true accustical 
message, when important mail arrive and are not irritated by 
spam.

----------------------------------------------------------------------

Comment By: Graham Bartlett (grab_rat)
Date: 2003-09-26 19:07

Message:
Logged In: YES 
user_id=633868

I'm not a Visual Basic/Windows expert.  But having used 
Outlook for a while, I *can* tell you that setting emails 
to &quot;read&quot; status stops the envelope icon coming up.  This 
would probably be the easiest fix, and would also stop the 
spam folder coming up with bold text to draw your attention 
to it.

----------------------------------------------------------------------

Comment By: Andrew Zaikin (ghuron)
Date: 2003-07-21 17:17

Message:
Logged In: YES 
user_id=824558

Since I could not attach files to #774908 I'm doing it here :) 
This is an example of how to hide envelope icon in tray.

----------------------------------------------------------------------

Comment By: Andrew Zaikin (ghuron)
Date: 2003-07-21 17:17

Message:
Logged In: YES 
user_id=824558

Since I could not attach files to #774908 I'm doing it here :) 
This is an example of how to hide envelope icon in tray.

----------------------------------------------------------------------

Comment By: Andrew Zaikin (ghuron)
Date: 2003-07-21 15:06

Message:
Logged In: YES 
user_id=824558

Sorry, duplicated to #774908. Too bad that nothing can be 
done here

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498106&aid=774978&group_id=61702


More information about the Spambayes-bugs mailing list