Hobby Chef

April, 2010 - Jive into Messaging world - Site Home - MSDN Blogs

Blog - Title

April, 2010

  • Jive into Messaging world

    WebDAV can expose private meetings/appointments to users who should not see them.

    • 0 Comments

    This is quite frequently asked and with surprise & worries mixed together… Why WebDAV is able to see my Private meetings/appointments? Isn’t this a security breach? How can I get it fixed?

    The answer is very simple, not this is not a bug. This is how it should work and then comes a even bigger surprise “FTW” from the receiver of this message.

    Let’s understand why this is so and what you should do and what you should not do to prevent such scenarios.

    There is no such thing as Private appointments/meetings in real sense and it’s a feature of the email client like Outlook/OWA. Exchange Server treat all items as same. Every calendar item has a field name “Sensitivity” which can store a value of “Normal”, “Personal”, “Private” & “Confidential”.

    In case of Private appointments this is marked as “Private” which allow the email client (Outlook/OWA) to decide if this should be displayed to the user or not. With that said, this is decided at the business logic layer in the email client.

    Now coming to the WebDAV, it has no business logic of itself and gives the requestor a raw output of the items/properties and leave it up to the client how they want to process those items. If you are writing a email client and want to have the same behavior as Outlook does then you should honor the value of Sensitivity before displaying the Item to the user.

    Exchange Server does not support Item level permissions and this is just a way to give users some sort of liberty to share restricted items when all the users are using Outlook or OWA. If you have users in your organization which may use other email clients then you should not give them Read access to your calendar/Tasks folder. This will prevent them from reading your private (or not so private?) items.

    This has been documented here as well:

    Outlook 2007: http://office.microsoft.com/en-us/outlook/HA100750811033.aspx?pid=CH100788801033

    Outlook 2003: http://office.microsoft.com/en-us/outlook/HP030741291033.aspx

  • Jive into Messaging world

    BUG: .NET 4.0 (System.Net.Mail) Unable to send emails with large attachments (more than 3MB)

    • 1 Comments

    This is probably the first bug reported by customer so far for System.Net.Mail Class in .NET 4.0 Framework, or at least the first one I worked on. This was pretty straight forward repro and I did not had to do much to reproduce the issue locally.

     

     static void Main(string[] args)
    
            {
    
                SmtpClient client = new SmtpClient("contoso_smtp_server");
                client.Credentials = new System.Net.NetworkCredential("User1", "Password", "contoso");
    
     
                MailMessage msg = new MailMessage("user1@contoso.com", "user2@contoso.com", "Large Attachment Mail", "Large Attachment - Test Body");
    
                Attachment attachment = new Attachment(@"d:\3mb.dat");
                msg.Attachments.Add(attachment);
    
                client.Send(msg);
    
          
            }

    That was the simplest code you could possibly write to send out email using SNM but the problem is it Fail with an “Error in sending email” message. So I looked around what was happening and found that the problem was not directly related to SNM but its underlying classes and specifically the Base64Encoding class which was used as default method of encoding emails attachments while sending.

    That saved me more troubleshooting and I changed the way the attachments were being encoded from Base64 to 7Bit and it worked like charm.

    So all you need to do is add any of the following line to your code to make it work.

    // Any "one" of those two code section will work
    attachment.TransferEncoding = System.Net.Mime.TransferEncoding.QuotedPrintable;
    attachment.TransferEncoding = System.Net.Mime.TransferEncoding.SevenBit;

    Since .Net 4.0 is still in beta there will not be any hotfix for this until we hit the RTM and there is no official word on when this bug will be fixed.

    UPDATE – 7/20/2010

    We have an official fix and here is more information about it.

    http://blogs.msdn.com/b/vikas/archive/2010/07/21/hotfix-net-4-0-system-net-mail-unable-to-send-emails-with-large-attachments-more-than-3mb.aspx

    UPDATE - 7/21/2010

    If you prefer not to contact PSS, you can download the hotfix by yourself from the following link.

    http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30226

    Happy Debugging!!!

Page 1 of 1 (2 items)