• Sign in
 
  •  
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...

  • Blog Home
  • About
  • Email Blog Author
  • Share this
  • RSS for posts
  • Atom
  • RSS for comments
  • CDO (25)
  • Code Snippet (43)
  • Custom Providers (17)
  • Debugging (7)
  • DevMsgTeam (301)
  • Documentation (109)
  • DST (8)
  • EWS (7)
  • Exchange (109)
  • Gotchas (97)
  • Hotfix (28)
  • MAPI (240)
  • MAPI Download (54)
  • MFCMAPI (101)
  • MSDN (59)
  • Non Dev (11)
  • OOM (17)
  • Outlook (171)
  • Outlook 2007 Auxiliary Reference (45)
  • Outlook Integration API (12)
  • Protocol Docs (20)
  • PST/OST (23)
  • Referrals (8)
  • Vista (12)
  • WrapPST (18)
Links:
  • Download MFCMAPI
  • MFCMAPI on Facebook
  • Troubleshooting Outlook Crashes
  • Office Update Center
  • Developer Messaging Team Blog
This site is provided "AS IS" with no warranties, and confers no rights. Use of included code samples are subject to the terms specified in the Terms of Use.
Archives
  • May 2013 (3)
  • April 2013 (1)
  • March 2013 (2)
  • February 2013 (2)
  • January 2013 (2)
  • December 2012 (4)
  • November 2012 (2)
  • October 2012 (2)
  • September 2012 (1)
  • August 2012 (3)
  • June 2012 (2)
  • May 2012 (1)
  • April 2012 (3)
  • March 2012 (3)
  • February 2012 (3)
  • January 2012 (1)
  • December 2011 (3)
  • November 2011 (1)
  • October 2011 (3)
  • September 2011 (1)
  • August 2011 (1)
  • July 2011 (4)
  • June 2011 (3)
  • May 2011 (3)
  • April 2011 (3)
  • March 2011 (5)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (1)
  • November 2010 (4)
  • October 2010 (1)
  • September 2010 (3)
  • August 2010 (5)
  • July 2010 (3)
  • June 2010 (3)
  • May 2010 (1)
  • April 2010 (3)
  • March 2010 (3)
  • February 2010 (3)
  • January 2010 (2)
  • December 2009 (3)
  • November 2009 (5)
  • October 2009 (4)
  • September 2009 (5)
  • August 2009 (5)
  • July 2009 (11)
  • June 2009 (6)
  • May 2009 (5)
  • April 2009 (3)
  • March 2009 (18)
  • February 2009 (10)
  • January 2009 (3)
  • December 2008 (2)
  • November 2008 (2)
  • October 2008 (5)
  • September 2008 (4)
  • August 2008 (10)
  • July 2008 (6)
  • June 2008 (8)
  • May 2008 (2)
  • April 2008 (4)
  • March 2008 (2)
  • February 2008 (2)
  • January 2008 (5)
  • December 2007 (3)
  • November 2007 (2)
  • October 2007 (3)
  • September 2007 (1)
  • August 2007 (4)
  • July 2007 (5)
  • June 2007 (3)
  • May 2007 (4)
  • April 2007 (1)
  • March 2007 (6)
  • February 2007 (3)
  • January 2007 (2)
  • December 2006 (4)
  • November 2006 (3)
  • October 2006 (1)
  • August 2006 (1)
  • June 2006 (5)
  • May 2006 (5)
  • December 2005 (1)
  • November 2005 (4)
  • October 2005 (2)
  • September 2005 (1)
  • April 2005 (3)
  • December 2004 (2)
  • September 2004 (2)
  • August 2004 (3)
  • July 2004 (3)

Outlook 2007 RTM Docs - Blocked Attachments

MSDN Blogs > SGriffin's MAPI Internals > Outlook 2007 RTM Docs - Blocked Attachments

Outlook 2007 RTM Docs - Blocked Attachments

Stephen Griffin - MSFT
1 Mar 2007 10:02 AM
  • Comments 4

[This is now documented here: http://msdn.microsoft.com/en-us/library/bb820936.aspx]  

(Now that Outlook 2007 is available I'm reposting some of the articles from the Outlook 2007 Beta Documentation series. Some of the articles are virtually unchanged, others are completely different to reflect the differences between Beta and RTM. This article is the updated version of Outlook 2007 Beta Documentation - Blocked Attachments.)

Microsoft Outlook includes a feature that blocks attachments that are considered unsafe. The attachments which are blocked can vary from client to client depending on how Outlook is configured and on policies the administrator may have applied. See http://support.microsoft.com/kb/829982 for more information on how this is configured.

Custom code can query to see if a particular attachment is considered blocked by Outlook using the IAttachmentSecurity interface. This interface exposes a function, IsAttachmentBlocked, which will analyze a file name and report if this attachment is considered blocked by Outlook and won’t be shown in the UI or indexed.

Definition

DEFINE_GUID(IID_IAttachmentSecurity,
			0xB2533636,
			0xC3F3, 0x416f, 0xBF, 0x04, 0xAE, 0xFE, 0x41, 0xAB, 0xAA, 0xE2);
#define MAPI_IATTACHMENTSECURITY_METHODS(IPURE) \
MAPIMETHOD(IsAttachmentBlocked) \
		(LPCWSTR pwszFileName, BOOL *pfBlocked) IPURE; 

DECLARE_MAPI_INTERFACE_(IAttachmentSecurity, IUnknown)
{
    BEGIN_INTERFACE
    MAPI_IUNKNOWN_METHODS(PURE)
    MAPI_IATTACHMENTSECURITY_METHODS(PURE)
};

Usage

This interface can be obtained by calling QueryInterface on the MAPI session object, requesting IID_IAttachmentSecurity. IsAttachmentBlocked will return true in pfBlocked if the attachment is considered blocked by Outlook and won’t be shown in the UI or indexed
HRESULT IsAttachmentBlocked(LPMAPISESSION lpMAPISession, LPCWSTR pwszFileName, BOOL* pfBlocked)
{
	if (!lpMAPISession || !pwszFileName || !pfBlocked) return MAPI_E_INVALID_PARAMETER;

	HRESULT hRes = S_OK;
	IAttachmentSecurity* lpAttachSec = NULL;
	BOOL bBlocked = false;

	hRes = lpMAPISession->QueryInterface(IID_IAttachmentSecurity,(void**)&lpAttachSec);
	if (SUCCEEDED(hRes) && lpAttachSec)
	{
		hRes = lpAttachSec->IsAttachmentBlocked(pwszFileName,&bBlocked);
	}
	if (lpAttachSec) lpAttachSec->Release();

	*pfBlocked = bBlocked;
	return hRes;
}// IsAttachmentBlocked
  • 4 Comments
Outlook, MAPI, Code Snippet, Documentation, Outlook 2007 Auxiliary Reference, DevMsgTeam, MSDN
Comments
  • outlookhates attachments
    30 Aug 2007 6:41 PM

    ...and wouldn't you find it strange that I have ended at this site, looking at a way to open an attachment that Outlook has decided is unsafe for me.

    Why, oh why do I not have the power to control this garbage myself? I dislike it when MSFT by default treats all users as idiots? And when we are not idiots, we are treated as idiots when trying to turn off features that we advanced users can't stand!!!!

    2c

  • Stephen Griffin - MSFT
    30 Aug 2007 7:22 PM

    If you're looking for a way to extract the blocked attachments, you can use mfcmapi (http://codeplex.com/mfcmapi).

    As for why blocked attachments can't be easily unblocked, suppose it were easy. Suppose it was just a reg key you have to set to unblock the attachments. Wouldn't that reg key be the first thing to get set in an attack?

  • James Ladan
    29 Jan 2008 5:05 PM

    Why not detect if an AV scanner is installed?  If the file is scanned & clean, allow it to be opened.

  • Stephen Griffin - MSFT
    29 Jan 2008 7:42 PM

    ?? This documentation isn't about how Outlook determines whether or not an attachment is safe. It's just about asking Outlook whether or not a file is going to be blocked.

Page 1 of 1 (4 items)
Leave a Comment
  • Please add 6 and 5 and type the answer here:
  • Post
  • © 2013 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy & Cookies
  • Report Abuse
  • 5.6.426.415