Google
Search WWW Search msexchangetips.blogspot.com

Tuesday, August 01, 2006

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

Summary:

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:

http://www.outlookexchange.com/articles/glenscales/mtrackrs.asp

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 = "User1@mydomain.com") Or (RecipientAddress1 = "user2@mydomain.com") 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
Cnxn1.Execute(sqlstate1)
End If
next
Next


Cnxn1.close

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.
http://www.dimastr.com/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")
objNS.Logon
' create the Message
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
SafeItem.Item = objOutlookMsg
With SafeItem
.to = "emailadmin@mydomain.com"
.Subject = "track"
.Body = "trackbody"
.Attachments.Add "C:\track" & Format(Date, "yymmdd") & ".html"
.Importance = 2 'High =2 low = 1
'.Display
.Save
.Send
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
exit

7. Run this batch file to test.

James Chong (MVP)
MCITP | EMA; MCSE | M+, S+
Security+, Project+, ITIL
msexchangetips.blogspot.com


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

13 Comments:

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 Unknown 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 Unknown 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  
Anonymous www.webhablada.es said...

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

6:37 AM  
Blogger Ralo 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 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  
Blogger John said...

coach outlet online
louboutin pas cher
cheap oakley sunglasses
ugg boots on sale
the north face outlet
nike air force 1
ugg boots
michael kors outlet online
beats by dre
ralph lauren outlet
canada goose
coach outlet online
chanel handbags
michael kors handbags
louis vuitton outlet stores
canada goose outlet
cheap jordans
uggs outlet
michael kors handbags
louis vuitton handbags
louis vuitton outlet
coach factory outlet
abercrombie & fitch
uggs on sale
oakley sunglasses wholesale
polo ralph lauren
michael kors outlet online
cheap soccer shoes
coach outlet store online
20151203yuanyuan

7:16 PM  
Anonymous Anonymous said...

true religion jeans
michael kors outlet
michael kors outlet store
tiffany jewelry
jordan retro
fitflops
jordan shoes on sale
http://www.outlettiffanyand.co
christian louboutin outlet
michael kors outlet
air huarache shoes
michael kors handbags outlet
nfl jerseys
fitflops clearance
cheap tiffanys
nike zoom kobe
michael kors handbags,michael kors handbags clearance,michael kors clearance
michael kors outlet
michael kors outlet store
michael kors handbags
fitflops clearance

7:29 PM  
Blogger Unknown said...

ralph lauren outlet
chaussures le coq sportif
kobe 12 shoes
true religion outlet
cheap ray ban sunglasses
hermes outlet
oakley sunglasses sale
adidas originals tubular
mlb jerseys wholesale
fitflops sale clearance
2017.4.6chenlixiang

11:43 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"