New Whitelist/Blacklist Outlook Plugin
|
Logged in as: Guest
|
|
Users viewing this topic:
none
|
|
Login | |
|
New Whitelist/Blacklist Outlook Plugin - 1.Feb.2009 3:34:58 AM
|
|
|
steve6341
Posts: 4
Joined: 26.Jul.2004
Status: offline
|
One thing I always thought GFI ME could use was a plugin module for Outlook to add email addresses to the Whitelist or Blacklist. Since I could not find one (because I don't think GFI has ever made one) I set out to create these buttons. I will warn you ahead of time that getting these installed is a little cumbersome. But if you follow these steps, you should get 2 buttons in your Outlook like these: A couple of things before I get going... -Right now I have only tested it with Outlook 2002 (XP) and Outlook 2003. -This code relies on the Remote Commands feature of MailEssentials. Check the MailEssentials documentation for help enabling this. -I currently only have access to MailEssentials 12. If I remember correctly, Remote Commands worked essentially the same in previous versions of ME. Therefore this will probably work with older versions. I don't know about MailEssentials 14. Let's get started. 1. Download my GFI.bas file from this link http://www.2kserver.com/gfi.bas (Right-click and Save Target AS...) Save this file someplace easy to remember like the desktop. This is a VBScript file that takes advantage of the Macros stuff built into MS Office. 2. Open Microsoft Outlook. Open the Visual Basic Editor from Tools -> Macro -> Visual Basic Editor -or- press ALT + F11. 3. From the File menu select Import File... Navigate to the GFI.bas file you downloaded in step 1. This should add 'GFI' to the 'Modules' tree on the left side. 4. Click the + next to Modules to expand that tree, then double click GFI. At the top of the code window on the right there are three lines of code that you must customize. If you use a password with Remote Commands, type the password in quotes next to GFIPass and Set UsePass = True. Set the GFIAddr = to the email address you use for Remote Commands. rcommands@mailessentials.com is the default. 5. Now, you will need a program included with Microsoft Office called selfcert.exe. This allows you to create certificates for your own macros so that the security settings in Outlook do not get in the way of their functions. Selfcert.exe is NOT installed with Office by default. You may have to add it from the CD. It will be located in c:\Program_Files\Microsoft_Office\Office1x\selfcert.exe. Run selfcert.exe and create a certificate. You can use your name (or really anything) to create a certificate. (FYI, you can manage certificates from certmgr.msc). 6. Open the Visual Basic Editor from step 2. Select Tools -> Digital Signature... Select the Choose... button. A window should open that displays the certificate you created in step 5. Select the certificate and click ok. Close the Visual Basic editor. 7. Navigate to Tools -> Macro -> Macros... or press ALT + F8. This should bring up the 'Macros' window. Run the macro called 'AddGFIBar'. This should install a toolbar in Outlook called GFI Commands. 8. Exit Outlook. When you re-open Outlook you should get a Macro Security Warning dialog box. You can select Always trust macros from this publisher and click Enable Macros. 9. Try the buttons now. If you have Outlook 2003, they should work fine. If you have Outlook 2002 (XP), you may still get some security warnings. Here's what to do if you get warnings with either version: (This is the easiest thing I can figure) Download and install Advanced Security for Outlook from mapilab http://www.mapilab.com/outlook/security After you install this a new dialog will come up when you click the new GFI buttons. You can select Allow access and check Always perform this action for this file. The security dialogs should not open in the future. That should do it. I think I covered everything. Let me know if there are any problems and I will try to fix them. I hope someone finds this useful...
< Message edited by steve6341 -- 8.Feb.2009 1:44:12 AM >
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 5.Feb.2009 3:07:28 PM
|
|
|
dameotech
Posts: 2
Joined: 5.Feb.2009
Status: offline
|
This is something our users have been screaming for for a long time. I will try this out as soon as I get a chance, but I was wondering if you tried copying the message to the appropriate GFI public folder (e.g., Public Folders > All Public Folders > GFI Antispam Folders > Add to blacklist) instead of using the remote commands? The user already should have create permissions on that public folder, so you should be able to copy the message. Or does the API prevent you from doing that? Thanks, David
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 5.Feb.2009 3:47:03 PM
|
|
|
steve6341
Posts: 4
Joined: 26.Jul.2004
Status: offline
|
The API is pretty flexible so it will probably let me do that. I will try the Public Folder route later and post the results. If that works, I could actually simplify the installation a little. Thanks
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 6.Feb.2009 12:04:28 PM
|
|
|
dameotech
Posts: 2
Joined: 5.Feb.2009
Status: offline
|
I'll be interested to see how it turns out. Please post back here if/when you figure it out. Thanks again, David
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 13.Feb.2009 5:46:04 PM
|
|
|
stephentitus
Posts: 16
Joined: 8.Nov.2004
From: Portland, OR
Status: offline
|
Steve, Thanks for the great suggestion for the command bar. I have a few standard commandbars and modified your code to simply add a label to the bar: Sub AddGFIBar() Dim cbGFI As CommandBar Dim ctlCBarButton As CommandBarButton Dim ctlCBarCombo As CommandBarComboBox Dim ctlCBarPopup As CommandBarPopup On Error Resume Next Set cbGFI = Application.ActiveExplorer.CommandBars("GFI Commands") If Err = 0 Then cbGFI.Delete End If Set cbGFI = Application.ActiveExplorer.CommandBars _ .Add(Name:="GFI Commands", Position:=msoBarTop) Set ctlCBarButton = cbGFI.Controls.Add(Type:=msoControlButton) With ctlCBarButton .Caption = "GFI:" .Style = msoButtonCaption .Visible = True .TooltipText = "GFI MailEssentails" End With Set ctlCBarButton = cbGFI.Controls.Add(Type:=msoControlButton) With ctlCBarButton .Caption = "Blacklist" .FaceId = 3734 .Style = msoButtonIconAndCaption .Visible = True .TooltipText = "Add to GFI Blacklist" .OnAction = "AddBlacklist" End With
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 10.Mar.2009 5:22:31 PM
|
|
|
johnmorgan
Posts: 3
Joined: 18.Jun.2008
Status: offline
|
Thanks for your work, Steve. I would like the Legitimate Email function to move the email to the Inbox and copy it to the Legitimate Email public folder. How can I do this? I tried to add this in the code but I don't know how to reference the user's inbox.
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 10.Mar.2009 8:02:37 PM
|
|
|
RSP
Posts: 1270
Joined: 31.Oct.2006
From: The East Riding of Yorkshire, UK
Status: offline
|
Set myInbox = myNamespace.GetDefaultFolder(6)
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 1.Jun.2009 1:32:03 PM
|
|
|
shoult
Posts: 5
Joined: 11.Oct.2004
From: Nashville, TN USA
Status: offline
|
I saw the blue color and got ALL excited thinking this was an answer for OWA. So close.......
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 11.Sep.2009 11:06:25 AM
|
|
|
parallon
Posts: 9
Joined: 10.Sep.2009
Status: offline
|
RSP, I am having problems implementing the part where it moves the message to the Inbox. In the "Public Sub SetVars()" section, I added Set myInbox = myNamespace.GetDefaultFolder(6) and under the "Sub AddWhitelist()" item I added Set dstFolder = myInbox but I keep getting "Object Required" errors. Thanks, Mike
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 11.Sep.2009 11:19:27 AM
|
|
|
RSP
Posts: 1270
Joined: 31.Oct.2006
From: The East Riding of Yorkshire, UK
Status: offline
|
You probably need to define it first: Insert before Public Sub SetVars(): Public myInbox as MAPIFolder Also, for the AddWhitelist routine: Sub AddWhitelist() SetVars Dele = False Set dstFolder = myFolder.Folders("Add to whitelist") PublicMove Dele = True Set dstFolder = myInbox PublicMove End Sub This should copy it to the "Add to whitelist", then copy it to Inbox and delete the original. Test it; I'm not a programmer!
_____________________________
Disclaimer: I don't work for GFI, I just use their products.
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 11.Sep.2009 1:00:24 PM
|
|
|
parallon
Posts: 9
Joined: 10.Sep.2009
Status: offline
|
Thank you for your help. It was actually 2 issues. First of all, you are right, I forgot to declare it in the beginning. Secondly, I forgot to call the PublicMove subroutine after the first Set dstFolder which was forcing me to set up a second variable (dstFolder2) because dstFolder was getting overwritten and only one result was getting processed. Thanks greatly for your help, Mike
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 12.Sep.2009 9:00:18 AM
|
|
|
sputnam
Posts: 28
Joined: 10.Jan.2007
Status: offline
|
WOW, this is so cool! Thanks Steve and friends, I've been hoping for such an Outlook addon. The SPAM moves it out of the Inbox to the SPAM public folder. Could one of you guys post the updated VB script that will move it to the Inbox after copying it to Legitamate / Whitelist folders? BTW, tested on Outlook 2003 and 2007, works great! Also, excellent instructions Steve, very easy. This is something that ME should have had built in, an absolute must have!
_____________________________
Regards, Steven
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 14.Sep.2009 5:09:39 AM
|
|
|
RSP
Posts: 1270
Joined: 31.Oct.2006
From: The East Riding of Yorkshire, UK
Status: offline
|
Try this. Note I am not a programmer, so test it before rolling it out! All of the non-spam buttons should now move the message to the inbox, courtesy of the following code:
Public myInbox As MAPIFolder
Set myInbox = myNamespace.GetDefaultFolder(6)
Dele = True
Set dstFolder = myInbox
PublicMove
Full code:
Attribute VB_Name = "GFI"
Public objItem As Object
Public dstFolder As Object
Public Dele As Boolean
Public myFolder As MAPIFolder
Public myInbox As MAPIFolder
Public myNameSpace As NameSpace
Public Sub SetVars()
Set myNameSpace = Application.GetNamespace("MAPI")
Set myFolder = myNameSpace.Folders("Public Folders").Folders("All Public Folders").Folders("GFI AntiSpam Folders")
Set myInbox = myNamespace.GetDefaultFolder(6)
End Sub
Sub AddBlacklist()
SetVars
Dele = True
Set dstFolder = myFolder.Folders("Add to blacklist")
PublicMove
End Sub
Sub AddWhitelist()
SetVars
Dele = False
Set dstFolder = myFolder.Folders("Add to whitelist")
PublicMove
Dele = True
Set dstFolder = myInbox
PublicMove
End Sub
Sub DiscussLst()
SetVars
Dele = False
Set dstFolder = myFolder.Folders("I want this Discussion list")
PublicMove
Dele = True
Set dstFolder = myInbox
PublicMove
End Sub
Sub isLegit()
SetVars
Dele = False
Set dstFolder = myFolder.Folders("This is legitimate email")
PublicMove
Dele = True
Set dstFolder = myInbox
PublicMove
End Sub
Sub isSpam()
SetVars
Dele = True
Set dstFolder = myFolder.Folders("This is spam email")
PublicMove
End Sub
Sub AddGFIBar()
Dim cbGFI As CommandBar
Dim ctlCBarButton As CommandBarButton
Dim ctlCBarCombo As CommandBarComboBox
Dim ctlCBarPopup As CommandBarPopup
On Error Resume Next
Set cbGFI = Application.ActiveExplorer.CommandBars("GFI Commands")
If Err = 0 Then
cbGFI.Delete
End If
Set cbGFI = Application.ActiveExplorer.CommandBars _
.Add(Name:="GFI Commands", Position:=msoBarTop)
Set ctlCBarButton = cbGFI.Controls.Add(Type:=msoControlButton)
With ctlCBarButton
.Caption = "Blacklist"
.FaceId = 3734
.Style = msoButtonIconAndCaption
.Visible = True
.TooltipText = "Add to GFI Blacklist"
.OnAction = "AddBlacklist"
End With
Set ctlCBarButton = cbGFI.Controls.Add(Type:=msoControlButton)
With ctlCBarButton
.Caption = "Whitelist"
.FaceId = 3733
.Style = msoButtonIconAndCaption
.Visible = True
.TooltipText = "Add to GFI Whitelist"
.OnAction = "AddWhitelist"
End With
Set ctlCBarButton = cbGFI.Controls.Add(Type:=msoControlButton)
With ctlCBarButton
.Caption = "Discussion List"
.FaceId = 3735
.Style = msoButtonIconAndCaption
.Visible = True
.TooltipText = "I want this Discussion list"
.OnAction = "DiscussLst"
End With
Set ctlCBarButton = cbGFI.Controls.Add(Type:=msoControlButton)
With ctlCBarButton
.Caption = "Legitimate Email"
.FaceId = 1087
.Style = msoButtonIconAndCaption
.Visible = True
.TooltipText = "This is legitimate email"
.OnAction = "isLegit"
End With
Set ctlCBarButton = cbGFI.Controls.Add(Type:=msoControlButton)
With ctlCBarButton
.Caption = "Spam"
.FaceId = 1088
.Style = msoButtonIconAndCaption
.Visible = True
.TooltipText = "This is spam email"
.OnAction = "isSpam"
End With
cbGFI.Visible = True
End Sub
Sub PublicMove()
'Dim myFolder As MAPIFolder
'Dim myNameSpace As NameSpace
Dim newCopy As Object
'Set myNameSpace = Application.GetNamespace("MAPI")
'Set myFolder = myNameSpace.Folders("Public Folders").Folders("All Public Folders")
Dim myItem As Object
Dim eaddr As String
Dim newItem As MailItem
Set mySelection = Application.ActiveExplorer.Selection
For i = 1 To mySelection.Count
Set myItem = mySelection.Item(i)
Dim objItem As MailItem
Set objItem = myItem
Set newCopy = objItem.Copy
newCopy.Move dstFolder
If Dele = True Then
objItem.Delete
End If
Next
End Sub
_____________________________
Disclaimer: I don't work for GFI, I just use their products.
|
|
|
|
RE: New Whitelist/Blacklist Outlook Plugin - 14.Sep.2009 7:52:09 AM
|
|
|
sputnam
Posts: 28
Joined: 10.Jan.2007
Status: offline
|
Works perfectly, thanks!
_____________________________
Regards, Steven
|
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|