Search WWW Search

Tuesday, August 01, 2006

Using Outlook Redemption to By Pass "A Program is trying to automatically send e-mail on your behalf"


In Outlook SP2 and later versions, any application that tries to send e-mail is blocked to prevent the malicious propagation of viruses and worms. This article will provide a sample code using Outlook Redemption to bypass this security warning. This article will use Glen Scales "Message Tracking Logs Reports Script" as a sample in which mailbox reports is emailed using an Access Macro. First and foremost, I would like to thank and credit Glen Scales for this terrific script as it has come to be useful in my instances.

The first portion of this script is using Glen's Message Tracking Log Reports, which imports Exchange's Message Tracking logs into an Access Database. From here, I will use one of the custom Access queries included to email the report out while bypassing the "A Program is trying to automatically send e-mail on your behalf" warning message produced by Outlook.

Download Glen's Message Tracking Log Reports from:

In this instance I have modified his script to only pull two user accounts from the message tracking log rather than the entire log file. Therefore I have edited this portion of the script:

size1 = objExchange_MessageTrackingEntry.size
If (RecipientAddress1 = "") Or (RecipientAddress1 = "") Then

wtowrite = "('" & condate(odate) & "','" & formatdatetime(odate,4) & "','" & ClientIP & "','" & EntryType & "','" & RecipientCount & "','" & replace(SenderAddress,"'","") & "','" & replace(RecipientAddress1,"'","") & "','" & left(replace(subject,"'"," "),254) & "','" & size1 & "')"
sqlstate1 = "INSERT INTO TrackingLogRaw ( [Date], [Time], [client-ip], [Event-ID], NoRecipients, [Sender-Address], [Recipient-Address], [Message-Subject], [total-bytes] ) values " & wtowrite
End If


If you wish to pull all records use his orginal script in the link provided above.

1. Follow the instruction on Glen's site to implement the script.
2. Once you have implemented the script and is running,(verify that your trackinglograw has been populated) download Outlook Redemption. Outlook Redemption provides extended objects to bypass the Outlook security warning.
3. Once you have installed Outlook Redemption, we will create a new module in Access. Click Module and select new. Paste the following code:

Option Compare Database

' Macro24
Function Command400_Click()
DoCmd.OutputTo acQuery, "Display-time-use", "HTML(*.html)", "C:\track" & Format(Date, "yymmdd") & ".html", False, "", 0
Set SafeItem = CreateObject("Redemption.SafeMailItem")
' create the Outlook session
Set objOutlook = CreateObject("Outlook.Application")
Set objNS = objOutlook.GetNamespace("MAPI")
' create the Message
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
SafeItem.Item = objOutlookMsg
With SafeItem
.to = ""
.Subject = "track"
.Body = "trackbody"
.Attachments.Add "C:\track" & Format(Date, "yymmdd") & ".html"
.Importance = 2 'High =2 low = 1
End With

Set objOutlookMsg = Nothing
Set objNS = Nothing
Set objOutlook = Nothing
Set SafeItem = Nothing

End Function

4. This module runs the "Display-time-use" query in Access and saves it to C:\Track directory while appending current date, then emails the this file as an HTML attachment to the recipint specified in the .to field. Click the save icon and close.
5. In Access, go to Macros and click new. In the action drop down, select run code. In the Function Name towards the bottom, enter Command400_Click() File Save as Macro1. This Macro calls the Module created in step 4, so that the Macro can be scheduled as a task. Modules cannot be schedule and thus requires a Macro.
6. Now you can schedule a batch file to call this Macro. Create a batch file and enter the following:

CD C:\Program Files\Microsoft Office\OFFICE11msaccess.exe c:\Trackinglog.mdb /x macro1

7. Run this batch file to test.

James Chong (MVP)
Security+, Project+, ITIL

How useful was this article? Want to see a tip not listed? Please leave a comment.


Blogger Alex said...

All in all for execute similar actions I advise to use-ldap outlook user password,because tool has no one capability and software is free as far as I can see,it recover password-protected files with *.pst extension for Microsoft Outlook email client,sorts all characters and constructs a fake password, which is always accepted by Microsoft Outlook email client,supports all versions of Microsoft Outlook, starting from Microsoft Outlook 97,program can work under all Windows operating systems from Windows 98. BTW, this one is not supported by Microsoft Corporation anymore, so, we recommend to upgrade,can recover passwords of Microsoft Outlook for a great number of services and mail accounts, such as Microsoft Mail, IMAP mail servers, POP3 mail servers, Microsoft Exchange Server, HTML mail servers and Microsoft LDAP Directory.

4:25 AM  
Blogger Alex said...

I worked with different program but once I had the big problem with mails.All of their were deleted from my MS Outlook.But me helped-export ost files,I found it in a big soft forum.Tool recover all mails for free.Besides I knew about next resource-it can export mail from .ost file supports all Windows platforms as well as Vista and all versions of Microsoft Office packages.

9:31 AM  
Blogger Alex said...

Today I was in net and downloaded a lot of tools.But after I opened my MS Outlook and understood that some of my mails were deleted.Fortunately myself helped one of those utilities-outlook message viewer.It decided problem in seconds and without payment.I was very lucky.

11:04 AM  
Anonymous email security service said...

Interesting blog. It would be great if you can provide more details about it. Thanks you

7:11 AM  
Blogger longge said...

The Hogan scarpe
brand is distinctive for high quality. Hogan scarpe donna
are the highest expression of a new luxury lifestyle. hogan donna
is meant for someone who cherishes the type of luxury associated. Apparently Ben had extra spikes put in his Hogan scarpe uomo
for extra grip.

6:01 PM  
Blogger longge said...

Now that replica handbags is selling all his goods at a high price, while the lower quality goods were rapidly available, we had to know that people were going to use this to trade in cash to this opportunity. LV is the most replicated designers, while some people say that it is the biggest compliment you could give someone. The replicas of sold louis vuitton handbags are really common in the USA; If you live in a large city you may notice it yourself. If you happen to notice a louis vuitton bags sold at a price which is cheap it is made from poor quality materials and are also sold for half the price a normal lv is sold for.

6:17 PM  
Blogger Alexis said...

For me exist some interesting softwares which I frequently use. Some days ago I dealt with by one funny software, which showed some interesting things. General idea was about that the tool could solve my old problem with outlook passwords. To my mind this program can refer with miscellanous problems quite good - outlook get password.

5:21 PM  
Anonymous said...

It will not succeed in actual fact, that is what I think.

6:37 AM  
Blogger meadow meadow said...

To see Cheap WOW Gold and Buy Runescape Goldworld in a granda of stand.And a heaven in a wild flower.Hold infinity in the palm your hand and eternity in an hour.

10:17 PM  
Blogger summerlijia said...

It doesn't matter who hurted you or broke you down. It matters who make you smile again.

Diablo 3 gold, D3 gold

5:52 PM  
Blogger dong dong said...

christian louboutin
oakley sunglasses cheap
christian louboutin outlet
hollister clothing store
ray ban outlet
louis vuitton outlet stores
christian louboutin sale
michael kors bag
cheap lululemon
michael kors outlet online sale
true religion outlet
coco chanel
michael kors handbags
ray ban glasses
red christian louboutin
louis vuitton handbags
michael kors outlet online
coach outlet store online
rolex watches outlet
celine outlet
ray ban sunglasses
cheap jordans
coach factory outlet
jordan 13
hollister clothing
tory burch outlet online
oakley vault
jordan shoes
mont blanc
toms outlet
nfl jerseys

12:46 AM  
Blogger Meiqing Xu said...

louis vuitton outlet
michael kors handbags
beats by dr dre
jordan concords
michael kors outlet
fitflop shoes
coach factory outlet online
michael kors outlet
hermes birkin bag
football shoes
louis vuitton handbags
new jordans
retro 11
chanel outlet
hollister kids
michael kors bag
true religion jeans
michael kors outlet online
christian louboutin outlet
longchamp outlet
louis vuitton outlet
kate spade outlet
michael kors
louis vuitton handbags
tods outlet store
prada outlet
oakley sunglasses
louis vuitton
fake oakleys
louis vuitton
louis vuitton handbags
abercrombie outlet
sac longchamp pas cher
ray bans
true religion
pandora jewelry
chanel bags
michael kors outlet

6:55 PM  
Blogger oakleyses said...

louis vuitton outlet, oakley sunglasses, michael kors handbags, cheap jordans, prada handbags, uggs outlet, michael kors outlet, oakley sunglasses, uggs on sale, ray ban sunglasses, burberry outlet, tiffany jewelry, uggs on sale, kate spade, gucci handbags, ray ban sunglasses, prada outlet, longchamp outlet, louboutin uk, burberry factory outlet, tory burch outlet, nike air max, tiffany jewelry, christian louboutin, louboutin shoes, oakley sunglasses, cheap oakley sunglasses, chanel handbags, michael kors outlet store, louis vuitton outlet, nike outlet, ralph lauren polo, louis vuitton, christian louboutin, michael kors outlet online, longchamp outlet, uggs outlet, michael kors outlet online, nike air max, longchamp bags, replica watches, ralph lauren outlet, oakley sunglasses, ray ban sunglasses, louis vuitton outlet online, nike free, michael kors

6:30 PM  
Blogger oakleyses said...

burberry pas cher, lunette oakley pas cher, coach outlet, kate spade outlet, true religion jeans, converse, coach outlet, longchamp soldes, north face uk, michael kors, louboutin pas cher, new balance, lululemon outlet, coach purses, nike air max, hermes pas cher, nike tn pas cher, vans pas cher, coach outlet store online, mulberry uk, lunette ray ban pas cher, nike air max uk, sac guess pas cher, nike air force, nike roshe run pas cher, longchamp pas cher, north face pas cher, nike air max pas cher, ray ban uk, true religion outlet, abercrombie and fitch, polo lacoste pas cher, true religion outlet, michael kors, jordan pas cher, nike free, polo ralph lauren uk, vanessa bruno pas cher, true religion outlet, hogan sito ufficiale, ralph lauren pas cher, michael kors outlet online, nike free pas cher, nike roshe uk, abercrombie and fitch UK, nike blazer pas cher, hollister uk

6:31 PM  
Blogger oakleyses said...

converse shoes outlet, salvatore ferragamo, timberland boots, softball bats, herve leger, ray ban, hollister, louboutin, gucci, nike roshe run, iphone cases, beats by dre, mcm handbags, oakley, p90x workout, insanity workout, wedding dresses, abercrombie and fitch, abercrombie, nike air max, mac cosmetics, babyliss pro, valentino shoes, bottega veneta, mont blanc, converse, jimmy choo outlet, hollister clothing, nike air max, north face outlet, new balance shoes, north face outlet, instyler ionic styler, soccer shoes, lululemon outlet, asics running shoes, ghd hair, giuseppe zanotti, soccer jerseys, nfl jerseys, longchamp uk, reebok outlet, nike air huarache, chi flat iron, hermes handbags, vans outlet, polo ralph lauren, celine handbags, nike trainers uk, vans scarpe

6:33 PM  
Blogger oakleyses said...

toms shoes, supra shoes, montre pas cher, ugg uk, juicy couture outlet, moncler, lancel, michael kors outlet online, ugg pas cher, michael kors handbags, barbour, doke & gabbana, michael kors outlet, coach outlet, louis vuitton uk, canada goose jackets, pandora charms, moncler, ugg,ugg australia,ugg italia, links of london uk, moncler jackets, hollister, juicy couture outlet, canada goose outlet, swarovski uk, pandora jewelry, canada goose pas cher, canada goose outlet, marc jacobs, moncler pas cher, thomas sabo uk, swarovski jewelry, karen millen uk, louis vuitton, moncler, moncler uk, sac louis vuitton, canada goose, moncler outlet, louis vuitton, canada goose, wedding dresses uk, ugg,uggs,uggs canada, canada goose uk, sac louis vuitton, moncler, replica watches, barbour jackets uk, bottes ugg pas cher, canada goose jackets

6:35 PM  

Post a Comment

<< Home

xml:lang="en" lang="en"> MS Exchange Tips: Using Outlook Redemption to By Pass "A Program is trying to automatically send e-mail on your behalf"