HOWTO: Add ASSP multiple report buttons in Microsoft Outlook

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
jpeoples
Normal user
Normal user
Posts: 67
Joined: 2004-07-01 05:56
Location: Ft Lauderdale, Fl US of A

HOWTO: Add ASSP multiple report buttons in Microsoft Outlook

Post by jpeoples » 2006-02-16 12:46

hi all...

I wanted an easy way for users to report misidentified spam/ham especially in the early stages of training my assp db...

here is a macro that works in outlook 2002(xp)
you have to first install redemption which can be found
here

spam reporting macro:-----------------------------------------------

Sub ForwardToSpam()

Dim objOL As Outlook.Application
Dim objSelection As Outlook.Selection
Dim objMsg As Object
Dim objNewMsg As Object

On Error Resume Next

' Instantiate an Outlook Application object
Set objOL = CreateObject("Outlook.Application")
' Get the collection of selected objects
Set objSelection = objOL.ActiveExplorer.Selection
' This code sends the all of the selected mail items
' one at a time.
For Each objMsg In objSelection
' This code sends one selected mail item at a time
If objMsg.Class = olMail Then
' Create a new mail item
Set objNewMsg = Application.CreateItem(olMailItem)
' send the new mail item to the spam reporting email address
objNewMsg.To = "assp-spam@yourdomain.com"
objNewMsg.Subject = objMsg.Subject
'save the new mail before adding attachments
objNewMsg.Save
' add selected mail item as attachment to new mail item
objNewMsg.Attachments.Add objMsg
' send the new mail item
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objNewMsg
objSafeMail.Send


' Clear the New Mail Item object
Set objNewMsg = Nothing
' Delete the spam mail item
objMsg.Delete

End If
Next


Set objMsg = Nothing
Set objSelection = Nothing
Set objOL = Nothing

Dim oBtn As CommandBarButton
Set oBtn = Application.ActiveExplorer.CommandBars.FindControl(1, 5488)
oBtn.Execute
Set oBtn = Nothing


MsgBox "Thank you for reporting spam!"


End Sub




What this will do is allow you to control click on multiple spam emails and then click on a button on your outlook toolbar to forward them as attachments to your assp web interface. This process will delete the offending email. I updated the the macro so that you don't have to push send receive anymore

Here is the macro to report misidentified ham or good email----------------------


Sub ForwardToNotSpam()

Dim objOL As Outlook.Application
Dim objSelection As Outlook.Selection
Dim objMsg As Object
Dim objNewMsg As Object

On Error Resume Next

' Instantiate an Outlook Application object
Set objOL = CreateObject("Outlook.Application")
' Get the collection of selected objects
Set objSelection = objOL.ActiveExplorer.Selection

' This code sends the all of the selected mail items
' one at a time.
For Each objMsg In objSelection
' This code sends one selected mail item at a time
If objMsg.Class = olMail Then
' Create a new mail item
Set objNewMsg = Application.CreateItem(olMailItem)
' send the new mail item to the spam reporting email address
objNewMsg.To = "assp-notspam@yourdomain.com"
objNewMsg.Subject = objMsg.Subject
'save the new mail before adding attachments
objNewMsg.Save
' add selected mail item as attachment to new mail item
objNewMsg.Attachments.Add objMsg
' send the new mail item
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objNewMsg
objSafeMail.Send


' Clear the New Mail Item object
Set objNewMsg = Nothing


End If
Next


Set objMsg = Nothing
Set objSelection = Nothing
Set objOL = Nothing

'send and receive
Dim oBtn As CommandBarButton
Set oBtn = Application.ActiveExplorer.CommandBars.FindControl(1, 5488)
oBtn.Execute
Set oBtn = Nothing


MsgBox "Thank you for reporting misidentified spam. "


End Sub



There is another macroset that works for outlook 2003 that doesn't require hitting send/receive or the redemption dll. I will post that sub in a day or two. NOTE this macro will not delete the good spam after reporting

Good luck to all...


and thank you Martin for making such a magnificent HMS program.....
Last edited by jpeoples on 2006-02-17 14:32, edited 1 time in total.

CraigHarris
Senior user
Senior user
Posts: 886
Joined: 2005-11-28 11:43

Post by CraigHarris » 2006-02-16 15:57

I would recomend using http://www.OLSpamCop.org/ for the purpose - it's free and installs easily into Outlook -- as it works with any reporting service, it is soon being renamed, but for now it still carries SpamCop in the name as that was it's original use.

jpeoples
Normal user
Normal user
Posts: 67
Joined: 2004-07-01 05:56
Location: Ft Lauderdale, Fl US of A

Post by jpeoples » 2006-02-16 17:36

well that certainly is an option. however, these macro's work perfectly and are simple to install across a medium sized domain. while i didn't actually go through the entire installation and configuration process of ol spam cop, it seemed to be a whole lot more complicated than installing these simple macro's...and i might add that installing the redemption outlook plugin was also part of the procedure for it as well. so to each his or her own (who thought i'd get politically correct at my advancing state of longevity?)....

CraigHarris
Senior user
Senior user
Posts: 886
Joined: 2005-11-28 11:43

Post by CraigHarris » 2006-02-16 22:52

We previously rolled out OLSpamCop & relevant settings on a 30 user domain, and it took very little time & works without hacking the .dll's

GlenC
Senior user
Senior user
Posts: 680
Joined: 2004-08-17 23:31
Location: Santiago, Chile

Post by GlenC » 2006-02-17 14:58

I wish someone could write one of these as an extension for Thunderbird. Sadly, I lack the skills :(

jpeoples
Normal user
Normal user
Posts: 67
Joined: 2004-07-01 05:56
Location: Ft Lauderdale, Fl US of A

Post by jpeoples » 2006-02-19 22:25

Glen i would love to be able to help you out...but while writing these macro's i developed hives and had three nearly fatal panic attacks...

grumpybug
New user
New user
Posts: 1
Joined: 2007-08-09 11:06

Post by grumpybug » 2007-08-09 11:47

While browsing the ASSP website I came across this which might be use for people. It's a ASSP toolbar for outlook.
http://www.asspsmtp.org/wiki/ASSP_Toolbar_for_Outlook

I've tested this with outlook 2007 and it seems to do the job.

User avatar
danny6167
Senior user
Senior user
Posts: 472
Joined: 2007-02-07 15:24
Location: Western Australia
Contact:

Post by danny6167 » 2007-08-09 14:59

is there any thing like this for thunderbird?

Post Reply