none
How to add blocked file types as attachments in an outlook mail item ? RRS feed

  • Question

  • I am trying to extract attachments from a mail and attach those files to another mail Item.
    Everything works fine but if I try to add an attachment wich has a blocked extention, the attachment wont get added to the mail Item. Following is what I have done 

           private void addAttachments( Redemption.RDOMail sourceMail , ref Redemption.RDOMail targetMail )                
                    {
                    foreach (Redemption.RDOAttachment attachment in sourceMail.Attachments)
                    {
                        // Saving attachment files from source mail on local disk 
                        attachment.SaveAsFile(/*File Path*/);

                        // adding attachment to target mail from saved location
                        //At this point, target mail has the attachment count incremented
                        targetMail.Attachments.Add(/*File PAth*/+ attachment.DisplayName);

                        // deleting file, saved on local disk
                        File.Delete(/*File Path + attachment.DisplayName*/);                   
                    }
                         targetMail.Save();

                        // when the mail item is being displayed, the added attachment with the *.EXE,
                        //or all the other attachment extentions which are blocked from viewing by outlook is gone.
                        // This does not happen for other attachment files
                        targetMail.Display();
                  }   

    Why are these particular attachment types won't get displayed ?

    Thanks.
    Monday, September 28, 2015 8:02 AM

Answers

  • >>>Adding list of extensions to the registry is not an option since it  will have an impact on other normal mails as well. So that is not an option.

    There are a lot of file types in which a virus can reside. The most known are executables (programs) and scripts (automated processes).

    At the moment there is a limited (but not a definite) list of file extensions that are known to be potential viruses. Outlook takes no chances and blocks these files whether or not it contains a virus because Outlook is not a virus scanner and therefore cannot determine whether the file is safe or not. This is actually a good thing; even unknown viruses will be blocked this way! The downside of this is that occasionally you could receive a file that you know is clean but still can't access. For instance; you receive a little (Flash) game or other program by e-mail.

     blockedattachments.png

    Blocked Attachments

    Outlook informs you about any blocked attachments in the message header

    So I suggest that you could send these files in a compressed (for instance zip or rar) format. This enables you to scan the file before unpacking and it will also take less inbox space and upload/download time!

    Tuesday, September 29, 2015 8:28 AM

All replies

  • Hello Kalpa,

    >  the attachment wont get added to the mail Item.

    Try to use any low-level property viewers such as MFCMAPI or OutlookSpy for exploring low-level properties. Are these attachments visible in viewers?

    You can unblock unsafe attachment types by adding corresponding extensions to the windows registry. See You may receive an "Outlook blocked access to the following potentially unsafe attachments" message in Outlook for more information.

    Monday, September 28, 2015 8:11 AM
  • The blocked attachment file extensions in outlook such as *.exe files are displayed in mail as following

    

    They cant be viewed in viewers unless  you save them on the local disk aren't they ?

    Adding list of extensions to the registry is not an option since it  will have an impact on other normal mails as well. So that is not an option.

     
    Monday, September 28, 2015 9:19 AM
  • >>>Adding list of extensions to the registry is not an option since it  will have an impact on other normal mails as well. So that is not an option.

    There are a lot of file types in which a virus can reside. The most known are executables (programs) and scripts (automated processes).

    At the moment there is a limited (but not a definite) list of file extensions that are known to be potential viruses. Outlook takes no chances and blocks these files whether or not it contains a virus because Outlook is not a virus scanner and therefore cannot determine whether the file is safe or not. This is actually a good thing; even unknown viruses will be blocked this way! The downside of this is that occasionally you could receive a file that you know is clean but still can't access. For instance; you receive a little (Flash) game or other program by e-mail.

     blockedattachments.png

    Blocked Attachments

    Outlook informs you about any blocked attachments in the message header

    So I suggest that you could send these files in a compressed (for instance zip or rar) format. This enables you to scan the file before unpacking and it will also take less inbox space and upload/download time!

    Tuesday, September 29, 2015 8:28 AM